Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, July 9, 2013

Create Virtual Host


Webmin is the best server admin panel, but some times it fails to do some jobs. Creating virtual host is one of them. So, I’m explaining code for creating virtual host. This is very easy to do. Just copy paste given code and that’s it.

Step 1) Open Apache2 configuration file

sudo gedit /etc/apache2/apache2.conf

Copy-paste this code:

######################wordpress-local.com -- start ###############
<VirtualHost *:80 >
ServerAdmin webmaster@localhost
ServerName wordpress-local.com
DocumentRoot /var/www/wordpress

<Directory >
  Options All
  AllowOverride All 
</Directory >

<Directory /var/www/wordpress>
  Options Indexes FollowSymLinks MultiViews
  AllowOverride All
  Order allow,deny
  allow from all
</Directory >


ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
< Directory "/usr/lib/cgi-bin" >
  AllowOverride None
  Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  Order allow,deny
  Allow from all
</Directory >

ErrorLog ${APACHE_LOG_DIR}/error.log

LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
< Directory "/usr/share/doc" >
  Options Indexes MultiViews FollowSymLinks
  AllowOverride All
  Order deny,allow
  Deny from all

Allow from 127.0.0.0/255.0.0.0 ::1/128

   < /Directory > 

< /VirtualHost >

######################wordpress-local.com -- over ###############

Step 2) Open  Hosts File

sudo gedit /etc/hosts

Write this code

127.0.0.1 localhost
127.0.0.1 wordpress-local.com     <<----- 

Step 3) Restart Apache server

sudo service apache2 reload

Now, you can open http://wordpress-local.com on your browser.

Sunday, June 2, 2013

Setup LAMP server on Ubuntu

Install Apache2 server


sudo apt-get install apache2




Install PHP

sudo apt-get install php5 libapache2-mod-hp5
Install MySQL

sudo apt-get install mysql-server


Install PHPMyAdmin
sudo apt-get install phpmyadmin
And select apache2 as shown in image below,

It'll ask for phpmyadmin configuration and press "NO".



Then type below commands:
sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf.d
sudo /etc/init.d/apache2 restart
Now, open your browser,




uninstall phpmyadmin:

sudo apt-get remove --purge phpmyadmin