Last active
December 30, 2015 12:49
-
-
Save octavian-nita/7831920 to your computer and use it in GitHub Desktop.
Configure Apache Virtual Host(s) and PHP usage; http://stackoverflow.com/questions/9110179/adding-virtualhost-fails-access-forbidden-error-403-xampp-windows-7 and http://foundationphp.com/tutorials/apache22_vhosts.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ==> In C:\WINDOWS\system32\drivers\etc\hosts or /etc/hosts | |
#127.0.0.1 localhost | |
#127.0.0.1 cs2 | |
## ==> In httpd.conf or apache2.conf | |
#Virtual hosts | |
#Include conf/extra/httpd-vhosts.conf | |
LoadModule php5_module "c:/Program Files/PHP/php5apache2_4.dll" | |
AddHandler application/x-httpd-php .php | |
<IfModule dir_module> | |
DirectoryIndex index.php index.html index.htm index.xhtml | |
</IfModule> | |
## ==> In httpd-vhosts.conf | |
NameVirtualHost *:80 | |
# Listen 80 # Apache 2.4 seems not to start when this line is enabled... | |
<VirtualHost *:80> | |
ServerName localhost | |
#ServerAlias www.localhost.com | |
ServerAdmin [email protected] | |
DocumentRoot "C:/Apache24/htdocs" | |
<Directory "C:/Apache24/htdocs"> | |
Options +Indexes +FollowSymLinks -MultiViews | |
AllowOverride All | |
Require all granted | |
# Replaces in 2.4: | |
#Order allow,deny | |
#Allow from all | |
</Directory> | |
ErrorLog "logs/localhost-error.log" | |
LogLevel warn | |
CustomLog "logs/localhost-access.log" combined | |
</VirtualHost> | |
<VirtualHost *:80> | |
ServerName cs2 | |
#ServerAlias www.cs2.com | |
ServerAdmin [email protected] | |
DocumentRoot "D:/Workspace/cadeauxsucres2" | |
<Directory "D:/Workspace/cadeauxsucres2"> | |
Options +Indexes +FollowSymLinks -MultiViews | |
AllowOverride All | |
Require all granted | |
# Replaces in 2.4: | |
#Order allow,deny | |
#Allow from all | |
</Directory> | |
ErrorLog "logs/cs2-error.log" | |
LogLevel warn | |
CustomLog "logs/cs2-access.log" combined | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment