Showing posts with label apache2. Show all posts
Showing posts with label apache2. Show all posts

Tuesday, February 12, 2013

Reinstall Setting up lamp server on ubuntu 12


-remove LAMP

apache2 apache2-mpm-prefork apache2-utils apache2.2-common libapache2-mod-php5 libapr1 libaprutil1 libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl libpq5 mysql-client-5.5 mysql-common mysql-server mysql-server-5.5 php5-common php5-mysql

-remove mySQL
mysql-client-core-5.5 mysql-server-core-5.5

apt-get remove mysql*

or
sudo apt-get purge apache2
sudo apt-get purge php5
sudo apt-get purge mysql-server
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get install apache2 php5 mysql-server

start reinstall

sudo apt-get install apache2
Open a web browser and navigate to http://localhost/. You should see a message saying It works!
sudo apt-get install mysql-server
sudo /etc/init.d/apache2 restart
sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
sudo gedit /var/www/testphp.php
<?php phpinfo(); ?>
sudo rm /var/www/testphp.php       

Monday, May 7, 2012

Apache 2

Common apache related command
-restart 
/etc/init.d/apache2 restart
 
-reinstall 
apt-get --reinstall install apache2.2-common 

-reinstall configuration files
apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2.2-common
 
-fully remove apache
apt-get purge apache2.2-common
apt-get remove --purge apache2 apache2-utils
 
-install apache
apt-get install apache2
   
 
Virtual Host 

vi /etc/apache2/sites-available/adabi
 

        ServerAdmin webmaster@localhost
        ServerName adabi

        DocumentRoot /var/www/adabi
        
                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
    
 
 
 
edit /etc/apache2/conf.d/fqdn
ServerName localhost 
 
edit 
/etc/hosts 
 
127.0.0.1       localhost.localdomain   localhost
127.0.0.1       localhost.localdomain   asf
127.0.0.1       localhost.localdomain   adabi
127.0.0.1       localhost.localdomain   open
 
 
activate virtual host :

a2dissite default 
a2ensite adabi
/etc/init.d/apache2 restart
 

Run, Stop, Test, And Restart Apache

 
/usr/sbin/apache2ctl start 
/usr/sbin/apache2ctl stop
/usr/sbin/apache2ctl restart
service apache2 restart 
/usr/sbin/apache2ctl configtest          ::test configuration