In this article, i’ll explain you how to set your Apache configuration on SuSE 9.2 to make your local websites visible on you machine. This is particularly useful for people like me who make websites and need to test them on their local machines before publish.
First of all, you need Apache installed on you machine via YaST with eventually PHP and MySql.
After that you’ll have all apache configuration files under /etc/apache2 directory.
Well DONT TOUCH ANY FILE THERE!
The simplest thing you have to do is create a mysites.conf file wherever you want and hardlink it to /etc/apache2/vhosts.d
I created mysites.conf in my public_html for my personal comfort :)
What about mysites.conf content? HERE to you a simple example:
Thus, the last thing to do is adding all our virtual servers on /etc/hosts file to make them available. This file is only accessible via root and this is a sample:
hosts This file describes a number of hostname-to-address
mappings for the TCP/IP subsystem. It is mostly
used at boot time, when no name servers are running.
On small systems, this file can be used instead of a
“named” name server.
IP-Address Full-Qualified-Hostname Short-Hostname
127.0.0.1 localhost linzekus XXXX <-list all virtual hosts HERE
special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
What else now? Point your browser on the URL of your new virtual hosts like that:
Thats all folks!