Setting up Apache-PHP-MySQL, phpMyAdmin on Ubuntu Bonus Track: Adding VirtualHost Before we start, make sure you are running as root. #sudo -i or #su or #sudo bash 1. Install Apache HTTP Server – apt-get install apache2 – Mabilis lang ito, wag ka muna magyosi
7
Embed
Setting up ApachePHPMySQL, phpMyAdmin on Ubuntu · 3. Install Database Server – sudo aptget install mysqlserver5.0 – you will be promted for the root password – pwede ka pa
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Setting up ApachePHPMySQL, phpMyAdmin on UbuntuBonus Track: Adding VirtualHost
Before we start, make sure you are running as root.#sudo i or #su or #sudo bash
1. Install Apache HTTP Server– aptget install apache2– Mabilis lang ito, wag ka muna magyosi
– then we have to tweak some settings of apache– #vim /etc/apache2/httpd.conf
– to prevent the error when starting apache => “apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName”
– Add this Line: ServerName localhost– ang document root ng apache ay /var/www/ as default. papalitan natin ito. gawin
<Directory /var/www/html/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory>
– Idagdag mo na rin ito, to make apache happy
DirectoryIndex index.htm index.html index.php
ScriptAlias /cgibin/ /usr/lib/cgibin/ <Directory "/usr/lib/cgibin"> AllowOverride None Options +ExecCGI MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory>
ErrorLog /var/log/apache2/error.log LogLevel warn
CustomLog /var/log/apache2/access.log combined ServerSignature On
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>
– tapos erase lahat ng laman ng file na 000default na nasa /etc/apache2/siteenabled/– We don't needed it anymore kasi inilagay na ntin ang laman nito sa
httpd.conf– Actually yung idinagdag natin sa httpd.conf na file starting at “ScriptAlias
/cgibin/ /usr/lib/cgibin/ ....” ay yung mga nakasulat sa file na ito.– Wag idedelete ang file na ito, erase lang ang content, gagamitin natin ito
mamaya sa Bonus track. =)– gawa tayo ng folder html sa loob ng /var/www/
– #mkdir /var/www/html– gawa tayo ng isang file sa loob ng /var/www/html as a default page
– #vim /var/www/html/index.php– Add this line
<?phpphpinfo();
?>
– Finally, Restart Apache– /etc/init.d/apache2 restart– After restarting apache, try this link: http://localhost– dapat ganito lalabas:
3. Install Database Server– sudo aptget install mysqlserver5.0– you will be promted for the root password– pwede ka pa magyosi bago mag propmt for the password.
4. Install Apache MySQL module and bundle MySQL to PHP– aptget install libapache2modauthmysql php5mysql
5. Install and Configure phpMyAdmin (Database Management)– download phpMyAdmin sa SouceForge– #tar xvfz [phpmyadmin tar file] C [DocRoot]– in this case: #tar xvfz Desktop/phpMyAdmin2.11.7rc1alllanguages/ C /var/www/html– #cd /var/www/html/– #mv phpMyAdmin2.11.7rc1alllanguages phpmyadmin– #cd phpmyadmin– #mv config.sample.inc.php config.inc.php– #vim config.inc.php– Lagayan ng value ang $cfg['blowfish_secret'] = '[whatever]';– Restart Apache: /etc/init.d/apache2 restart– Check phpmyadmin: http://localhost/phpmyadmin– username: root– password: your_password (yung inilagay mong password sa no.3)