Hello every one, i included follwinf in my httpd.config file # START CODEfrom httpd.config file placed under Listen: line <VirtualHost myipaddress:80> ServerName phpweb20 DocumentRoot "c:/wamp/www/phpweb20/htdocs" <Directory "c:/wamp/www/phpweb20/htdocs"> AllowOverride None Options All </Directory> php_value include_path ".;c:/wamp/www/phpweb20/include;c:/wamp/bin/php/PEAR" php_value magic_quotes_gpc off php_value register_globals off </VirtualHost> #end COde and i modified C:\Windows\System32\drivers\etc\hosts file and add the following myipaddress phpweb20 and now when i try to access http://phpweb20/ from my browser i gor a 403 forbidden error. Any thoughts on how to do this. if you need any additional info i'll be glad to post it
Server name needs to have a fully qualified domain name. For example: ServerName phpweb20.digitalpoint.com Code (apache):
@digitalpoin I am talking abt local development here do i even then need a fully qualified domain name . what i am trying to do is ' when i type http://phpweb20/ my browser take me to my application index rather than typing http://localhost/phpweb20/index.php or any thing else i am following a book please check it , its "Appress Building Web 2.0 application with PHP" i can pm / email you the chapter if needed
Still need to use a fully qualified domain in the Apache config... it doesn't know if your browser is or is not using one.
i am sending chapter here please tell me what to do with that 403 Configuring the Web Server A typical development setup is to use your normal computer (such as your Windows or Mac OS machine) to write your code, while running the web server on another server. In such a case, you need to access the web server over a network. For example, I use a Windows machine for my day-to-day work, while my web server is a FreeBSD machine elsewhere in the office. ■Tip I aim to keep my development web server configured identically to my production server, as this helps to eliminate any unforeseeable issues that may arise when deploying my code (such as different versions of linked libraries). For the purposes of this book, I assume the web application is accessible using the web address http://phpweb20. In order to access my web server using this hostname, I make a fake DNS entry in my Windows host file so my browser will resolve the phpweb20 hostname to 192.168.0.80. This is the entry I add in my Windows hostname file (c:\windows\system32\ drivers\etc\hosts in Windows XP): 192.168.0.80 phpweb20 ■Note Setting up a host as described here is not related to the development of the web application, but rather allows you to access it in your web browser. Creating fake hostnames is a simple trick for development purposes, eliminating the need for a DNS server or a real domain. Once you deploy your application live, you will need to use a real hostname so other people can access your web site. If you have control over a real DNS server, you may instead prefer to create your own hostname. (Just keep in mind that I continually refer to phpweb20 throughout this book.) ■Note You could use IP-based hosting, which would allow you to simply access http://192.168.0.80. Since name-based hosting in Apache is arguably the most common setup, I’ve chosen instead to use the method described previously (that is, setting up a fake hostname). Obviously, using a real hostname is better, but I’ve tried to simplify matters by not requiring it for this book Creating a Virtual Host in Windows Creating a virtual host in Windows is similar to the process in the previous section, except that the paths must be adjusted. Note also that the PHP include_path directive uses a semicolon as the separator rather than a colon, since a colon is used to indicate a drive label. Listing 2-2 shows the Windows equivalent of Listing 2-1. Once again, you will need to include it in the main web server configuration file, typically found in C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf onWindows. Listing 2-2.Web Server Configuration for Apache on Windows (httpd.conf) <VirtualHost *:80> ServerName phpweb20 DocumentRoot "c:/www/phpweb20/htdocs" <Directory "c:/www/phpweb20/htdocs"> AllowOverride None Options All </Directory> php_value include_path ".;c:/www/phpweb20/include;c:/program files/php/pear" php_value magic_quotes_gpc off php_value register_globals off </VirtualHost> please tell me how to set this up
Could you please comment Opions All from the virtualhost and restart the apache and try accessing the link?
Thanks for your replies if found this http://apptools.com/phptools/virtualhost.php i thought that it could be helpful to any one else so i am posting it here BTW thanx u all!
No i didn't made. I put NameVirtualHost and same host name in c:\windows\system32\drivers\etc\hosts file but it works and traditional http://localhost is available for other site (local) . problem is solved,,, .