search by tags

for the user

adventures into the land of the command line

building a lamp server

lamp.. linux, apache, mysql, php a popular recipe for serving web applications for a long time. tried and true. it’s surprisingly easy to set one up sudo to root

$ sudo su -

update all packages

$ yum update -y

install required applications

$ yum install -y httpd php mysql mysql-server php-mysql

make sure permissions are set

$ chown -R apache:apache /var/www/html/

start apache

$ service httpd start

start mysql and install a database

$ service mysqld start
$ mysql_secure_installation

when prompted, enter a password for the root account. enter the current root password. by default, the root account does not have a password set, so press enter.
type Y to set a password, and enter a secure password twice.
type Y to remove the anonymous user accounts.
type Y to disable remote root login.
type Y to remove the test database.
type Y to reload the privilege tables and save your changes.

have apache & myqsl start up automatically when the OS boots:

$ chkconfig httpd on
$ chkconfig mysqld on

restart the db

$ service mysqld restart

create a test index page

$ vim /var/www/html/phpinfo.php

insert this text into the file

<?php phpinfo(); ?>

to access via a browser

http://youserversipaddress/phpinfo.php

….aaand done.