Below is an example to host an extra web server in port 8081 in localhost.
Add following lines in conf/httpd.conf in Apache:
---------------------------------------------------------------------------
# testserver website
ServerName egps.localhost:8081
DocumentRoot C:/Users/jiansen/Desktop/testserver/htdocs
Options FollowSymLinks
AllowOverride None
DirectoryIndex index.php
php_value include_path ".;C:/Users/jiansen/Desktop/testserver/etc/"
Order allow,deny
Allow from all
#RewriteEngine On
#RewriteRule !maintenance_msg\.php$ /maintenance_msg.php [R,L]
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://localhost/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://192.168.1.52/.*$ [NC]
RewriteRule .*\.(jpe?g|png|gif|bmp|swf|flv) - [NC,F,L]
</Directory>
</VirtualHost>
----------------------------------------------------------------------------------------------------------
Explanation:
The extra web server port is 8081 in localhost, the document root is
C:/Users/jiansen/Desktop/testserver/htdocs, load index.php by default,
php include path is: C:/Users/jiansen/Desktop/testserver/etc/
No comments:
Post a Comment