# Installation PowerOfDark CMS website

- [Installation PowerOfDark CMS website](#installation-powerofdark-cms-website)
  - [PHP Configuration](#php-configuration)
- [OPTIONAL - Multi Domain / Apache Vhost](#optional---multi-domain--apache-vhost)
    - [(Optional) Disable the access by IP with a 403 (so you can still use www folder)](#optional-disable-the-access-by-ip-with-a-403-so-you-can-still-use-www-folder)
    - [Remove the following lines if exists](#remove-the-following-lines-if-exists)
    - [Add the following lines to Generic multi server with C:\\AppServ\\www as main folder](#add-the-following-lines-to-generic-multi-server-with-cappservwww-as-main-folder)
      - [Alternative - Generic multi server with C:\\Servers{server}\\www as main folder](#alternative---generic-multi-server-with-cserversserverwww-as-main-folder)

## PHP Configuration

1. Modify the file `php.ini` usually located at `C:\xampp\php\php.ini` and set the following variables:

Locate:

```ini
;extension=gd
;extension=openssl
;extension=pdo_mysql
```

And remove the `;` at the beginning of the line, this should let you this line:

```ini
extension=gd
extension=openssl
extension=pdo_mysql
```

2. Restart the computer or AppServ

3. (ONLY STREAM REQUIRED): Duplicate `php.ini` with the name `php-cli.ini`


# OPTIONAL - Multi Domain / Apache Vhost

1. Open `C:\AppServ\Apache2\conf\httpd.conf`
2. Uncomment or add the following lines:
```ini
LoadModule vhost_alias_module modules/mod_vhost_alias.so
Include conf/extra/httpd-vhosts.conf
```

1. Go to `C:\AppServ\Apache2\conf\extra\httpd-vhosts.conf`
2. Add the lines described as the next sections
3. Restart the computer or AppServ

### (Optional) Disable the access by IP with a 403 (so you can still use www folder)

```ini
<VirtualHost *:80>
    ServerName xxx.xxx.xxx.xxx
    Redirect 403 /
    DocumentRoot /var/www/html
</VirtualHost>
```

### Remove the following lines if exists

```ini
<VirtualHost _default_:80>
DocumentRoot "${SRVROOT}/htdocs"
#ServerName www.example.com:80
</VirtualHost>
```

### Add the following lines to Generic multi server with C:\AppServ\www as main folder

```ini
# MANDATORY (default website)
<VirtualHost *:80>
    ServerAdmin info@cotowers.net
    DocumentRoot "C:/xampp/htdocs"
    ServerName cotowers.net
    ServerAlias www.cotowers.net
</VirtualHost>

# New Websites
<VirtualHost *:80>
    ServerName otherserver.es
    ServerAlias www.otherserver.es
    DocumentRoot "C:/otherserver.es/www"
    <Directory "C:/otherserver.es/www">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

# ALTERNATIVE (to the 2nd)
; <VirtualHost *:80>
;     ServerAdmin webmaster@localhost
;     DocumentRoot "C:/otherserver/www"
;     ServerName otherserver.es
;     ServerAlias www.otherserver.es
; </VirtualHost>
; <Directory "C:/otherserver.es/www">
;     # Options -Indexes FollowSymLinks
;     AllowOverride None

;     Order allow,deny
;     Allow from all
;     Require all granted
; </Directory>


```

#### Alternative - Generic multi server with C:\Servers\{server}\www as main folder

```ini
# CoTowers
<VirtualHost *:80>
    ServerAdmin info@cotowers.net
    DocumentRoot "C:/servers/cotowers/www"
    ServerName cotowers.net
    ServerAlias www.cotowers.net
	<Directory "C:/servers/cotowers/www">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

# CoPower
<VirtualHost *:80>
    ServerName copower.es
    ServerAlias www.copower.es
    DocumentRoot "C:/servers/copower/www"
    <Directory "C:/servers/copower/www">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
```
