php --version
    /usr/sbin/apache2 -v

Error Log

maximum upload size 2M usually for development and back-up recivery purposes set it to 64

Error Log


        sudo apt-get install apache2
I tried to install apache http server from source file. it ran and worked correctly binding to the port 80. but it didn't make the /etc directory for me. My purpose was to use subversion in http protocol. This didn't work, so I had to do the sudo apt-get install apache2 again


Config File


$ cd /.../apache2/bin
$./apachectl start
$./apachectl stop
$./apachectl restart


$ sudo /etc/init.d/apache2 restart
$ sudo /usr/sbin/apache2ctl start
$ sudo /usr/sbin/apache2ctl stop

Home Address

Subdomain for Localhost

$ sudo vim /etc/hosts
add line:       subdomain.localhost
create a new configuration file in /etc/apache2/sites-available, and then enable the new site with the command a2ensite
$ sudo vim myConfig
Put the following lines in the file:
<VirtualHost *>
        DocumentRoot /home/username/mysite
        ServerName subdomain.localhost

        <Directory /home/username/mysite/>
                Options Indexes FollowSymLinks MultiViews +Includes
                AllowOverride None
                Order allow,deny
                allow from all

$ sudo a2ensite myConfig
$ sudo /etc/init.d/apache2 restart

Now you can browse to http://subdomain.localhost/

The information of the directories could also be in the active httpd.conf   e.g.  /usr/local/apache/conf/httpd.conf  specially in cpanel.

Add Virtual Host   

here virtual host is not in the httpd directory of apache and is totally outside. You do not need to set any permissions outside of the following. imagine if the website you are designing is grocery.com, to develop it locally have a subdomain lc which you are sure is not a subdomain of your website.

<VirtualHost *:80>
    #ServerAdmin postmaster@dummy-host2.localhost
    DocumentRoot "D:/ShahriariNia/Resources/My Dropbox/workspaces/Grocery/codeigniter"
    ServerName lc.grocery.com
    <Directory "D:/ShahriariNia/Resources/My Dropbox/workspaces/Grocery/codeigniter">
          Options Indexes FollowSymLinks
           AllowOverride all
           Order allow,deny
           Allow from all
           Require all granted
    ##ServerAlias www.dummy-host2.localhost
    ErrorLog "logs/lc.grocery.com-error.log"
    CustomLog "logs/lc.grocery.com-access.log" combined
</VirtualHost> lc.grocery.com

For example, suppose that you are serving the domain www.domain.tld and you wish to add the virtual host www.otherdomain.tld, which points at the same IP address. Then you simply add the following to httpd.conf:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain

<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain