Monday, November 19, 2012

debian6 install php


debian6 install php

http://library.linode.com/web-servers/apache/installation/debian-6-squeeze
http://library.linode.com/lamp-guides/debian-6-squeeze



apache virtual host file location linux
http://www.debuntu.org/2006/02/22/7-virtual-hosting-using-apache-2


Now, we specified a new host to apache but it is not yet linked to the repertory where apache actually look for virtual hosts. Let go to:
$cd /etc/apache2/sites-enabled/
and create a link to the file we just created:
$sudo ln -s /etc/apache2/sites-available/example.com.conf example.com.conf
Now apache is almost ready to restart, but before doing so, we must inform our linux system that dev.example.com and www.dev.example.com are not to be looked for on the net, but on the local machine instead.
To do so, simply edit /etc/hosts and add the new host names at the end of the line beginning by 127.0.0.1, which is localhost.
In the end, your file should look like:
127.0.0.1 localhost.localdomain localhost dev.example.com www.dev.example.com
And now we are done, simply reload apache:
sudo /etc/init.d/apache2 reload
Open your web browser and enter the following address dev.example.com. Magic, it runs the same as when you were using http://localhost/~myuser/example.com but it is far more usefull when devellopping a web service and want to be able to develop applications on your machine just like it is where the real web site.
Edit: As you can see from the comments, many people pointed out that you can use a debian specific command (so if you are not using a debian based system, don't expect to find that command :) ).
to enable a new virtual host simply type:
sudo a2ensite mysiteavailable-site
to disable a virtual host:
sudo a2dissite mysiteavailable-site
where mysiteavailable-site is the name of the virtual hos you want to enable/disable, so in out example: example.com.conf
Hope this helped.





http://help.hardhathosting.com/question.php/95

How do I create a symbolic link?
ln -s [TARGET DIRECTORY OR FILE] ./[SHORTCUT]
For example:
ln -s /usr/local/apache/logs ./logs
This points a symbolic link "./logs" to "/usr/local/apache/logs"






On my server I use the  'DirectoryIndex' directive and make sure index.php is listed there.  Then whenever you hit that directory it will search for 'index' files in the order they are listed in the DirectoryIndex directive.  I change the order around depending on if a site will be mostly serving up .html files or .php or something else...

Here is an example snipped out of my Vhosts.conf file...

ServerPath /var/www/html/domainname/joomla
DocumentRoot /var/www/html/domainname/joomla

DirectoryIndex index.php index.html index.cgi index.shtml index.htm index.pl










No comments:

Post a Comment