Web development and Linux Web Server cloning
Page 1 of 1
Web development and Linux Web Server cloning
The default directory for files of a site is in /var/www. To access this directory, we need rights of root. To create a website, for example, /home/user/www/ perform the following steps:
1. Make a copy of the standard config file site (/etc/apache2/sites-available/default) and rename it to (/etc/apache2/sites-available/mysite).
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mysite
2. Open a new config file in a text editor nano.
sudo nano /etc/apache2/sites-available/mysite
3. Change the DocumentRoot setting in the new location site.
/home/user/www/
4. Change the parameter Directory, replacing on . So, you you get something like:
ServerAdmin webmaster@localhost
DocumentRoot /home/stleon/www
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
5. Now you have to deactivate the old site (default) and add a new (mysite).
sudo a2dissite default && sudo a2ensite mysite
6. Restart Apache2:
sudo /etc/init.d/apache2 restart
7. Then open with gedit /etc/apache2/envvars:
sudo gedit /etc/apache2/envvars
8. Find export APACHE_RUN_USER=www-data and export APACHE_RUN_GROUP=www-data. Replace it to
export APACHE_RUN_USER=username export APACHE_RUN_GROUP=username
9. Restart Apache2:
sudo /etc/init.d/apache2 restart
If after you do this you get any errors this example will help you
I fixt it manually with:
1. Make a copy of the standard config file site (/etc/apache2/sites-available/default) and rename it to (/etc/apache2/sites-available/mysite).
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mysite
2. Open a new config file in a text editor nano.
sudo nano /etc/apache2/sites-available/mysite
3. Change the DocumentRoot setting in the new location site.
/home/user/www/
4. Change the parameter Directory, replacing
ServerAdmin webmaster@localhost
DocumentRoot /home/stleon/www
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
Save the file.
ServerAdmin webmaster@localhost
DocumentRoot /home/stleon/www
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
5. Now you have to deactivate the old site (default) and add a new (mysite).
sudo a2dissite default && sudo a2ensite mysite
6. Restart Apache2:
sudo /etc/init.d/apache2 restart
7. Then open with gedit /etc/apache2/envvars:
sudo gedit /etc/apache2/envvars
8. Find export APACHE_RUN_USER=www-data and export APACHE_RUN_GROUP=www-data. Replace it to
export APACHE_RUN_USER=username export APACHE_RUN_GROUP=username
9. Restart Apache2:
sudo /etc/init.d/apache2 restart
If after you do this you get any errors this example will help you
I fixt it manually with:
- Code:
sudo chown -R ciaobello:ciaobello /var/lock/apache2
Similar topics
» Web Dev Linux Web Server PHP GAME DEV
» Linux Android Development
» Setting up linux ssh server
» Installing Syslog For Linux Web Server
» do anything with images and linux web server
» Linux Android Development
» Setting up linux ssh server
» Installing Syslog For Linux Web Server
» do anything with images and linux web server
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum