Tuesday, April 21, 2015

LAMP easy set-up method on ubuntu 14.04 trusty including wordpress app.

LAMP easy set-up method on ubuntu 14.04 trusty including wordpress app.

Linux+Apache+Mysql-server+php is simply installed by following one line command on ubuntu.
root@ts#sudo tasksel install lamp-server
root@ts# vi /var/www/html/index.php
<?php
phpinfo();
?>
With brower you can check php option and etc.



#Installing popular wordpress php-based webapplication.






root@ts:/var/www/html# unzip latest.zip
root@ts:/var/www/html/wordpress# vi /root/mysql_create_wordpress.sh

#Creating database and user for wordpress app.
mysql -u root -prootpass <<EOF
CREATE DATABASE IF NOT EXISTS wordpress;
USE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* to wordpress@localhost identified by 'wordpresspass';
FLUSH PRIVILEGES;
EOF
~

#There should be no errors.
root@ts:/var/www/html# bash /root/mysql_create_wordpress.sh

root@ts:/var/www/html/wordpress# vi /root/change_wordpress.sh
#!/usr/bin/env bash
#Using sed to change default name dbname and password. Optionally hostname(commented on)
sed -i 's/database_name_here/wordpress/g' /var/www/html/wordpress/wp-config.php
sed -i 's/username_here/wordpress/g' /var/www/html/wordpress/wp-config.php
sed -i 's/password_here/wordpresspass/g' /var/www/html/wordpress/wp-config.php
#sed -i 's/localhost/wanted_ip_or_hostname/g' /var/www/html/wordpress/wp-config.php
~
#There should be no errors.
root@ts:/var/www/html/wordpress# bash /tmp/change_wordpress.sh


#Email address should be valid(real domain check is enabled by default)





#Now login..and then next picture like shows. What a nice php app!





No comments:

Post a Comment