LAMP on ubuntu12.04 PHP, Apache2, MySQL, Linux ( with phpmyadmin installed)

there are several procedure which include:

1. Install the packages

sudo apt-get install php5 php5-gd php5-cgi php5-mysql libapache2-mod-php5 apache2 mysql-client mysql-server -y

2. Configure the mysql database password if necessary

3.edit file 

/etc/apache2/sites-available

touch /etc/apache2/sites-available/mysite

---

put something like this in the file 'myfile':

<VirtualHost *:80>                                                                                                            
        ServerAdmin webmaster@localhost                                                                                       
                                                                                                                              
        DocumentRoot /var/www                                                                                                 
        DirectoryIndex index.html index.php index.htm                                                                         
        <Directory />                                                                                                         
                Options FollowSymLinks                                                                                        
                AllowOverride None                                                                                            
        </Directory>                                                                                                          
        <Directory /var/www/>                                                                                                 
        <Files *.html,*.htm,*.php>                                                                                            
                Options Indexes FollowSymLinks MultiViews                                                                     
                AllowOverride None                                                                                            
                Order deny,allow                                                                                              
                allow from all                                                                                                
                </Files>                                                                                                      
        </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                                                                                  
                                                                                                                              
        # 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/"                                                                                             
    <Directory "/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                                                                                
    </Directory>                                                                                                              
                                                                                                                              
</VirtualHost> 

4.restart the apache2 service using:

service apache2 reload

5.write the first PHP page:

$ cat > /var/www/phpinfo.php << EOF
<?php
phpinfo();
?>
EOF

6. using the browser to check the page out!

Input your site and the pages

http://your_site_ip/phpinfo.php

Then you will see something like this:

7. install phpMyAdmin 

wget -c http://dlsw.baidu.com/sw-search-sp/soft/26/14218/phpMyAdmin-4.1.4-all-languages.3715384168.zip -O /tmp/phpMyAdmin-4.1.4-all-languages.zip
 unzip /tmp/phpMyAdmin-4.1.4-all-languages.3715384168.zip -d /var/www
mv phpMyAdmin-4.1.4-all-languages/ sqladmin # for secure reason coz there could be some blackcat miu scanning, you know.

8. open the page there:

http://your_site_ip/sqladmin

you would see:

and login then,

原文地址:https://www.cnblogs.com/spaceship9/p/3843754.html