If you installed the server in a different path
In case you installed the Apache web server in a different path, you must be careful with the following parameters in http.conf:
1. ServerRoot
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used. If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#
Define SRVROOT "C:/Program Files/edinn/edinnM2/Server/websrv/Apache"
ServerRoot "${SRVROOT}"
2. DocumentRoot.
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/Program Files (x86)/edinn/edinnM2/Server/websrv/Apache/htdocs"
<Directory "C:/Program Files (x86)/edinn/edinnM2/Server/websrv/Apache/htdocs">
3. LoadModule php7_module and PHPIniDir
LoadModule php7_module "C:/Program Files/edinn/edinnM2/server/websrv/php/php7apache2_4.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/Program Files/edinn/edinnM2/server/websrv/php"
4. Virtual hosts
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Additionally, change the following in file conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "C:/Program Files (x86)/edinn/edinnM2/Server/websrv/Apache/htdocs"
ServerName localhost
Header set Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, PATCH"
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/Program Files (x86)/edinn/edinnM2/Server/websrv/Apache/htdocs"
ServerName 127.0.0.1
Header set Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, PATCH"
</VirtualHost>
# Add any other Virtual Hosts below
<VirtualHost *:8080>
DocumentRoot "C:/Program Files (x86)/edinn/edinnM2/Server/websrv/Apache/htdocs/edinnM2/API/REST/public"
ServerName localhost:8080
Header set Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, PATCH"
ErrorLog "logs/error.log"
<Directory "C:/Program Files (x86)/edinn/edinnM2/Server/websrv/Apache/htdocs/edinnM2/API/REST/public" >
DirectoryIndex index.php
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot "C:/Program Files (x86)/edinn/edinnM2/Server/websrv/Apache/htdocs/edinnM2/API/REST/public"
ServerName 127.0.0.1:8080
Header set Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, PATCH"
ErrorLog "logs/error.log"
<Directory "C:/Program Files (x86)/edinn/edinnM2/Server/websrv/Apache/htdocs/edinnM2/API/REST/public" >
DirectoryIndex index.php
AllowOverride All
</Directory>
</VirtualHost>