How to setup Apache, MySQL, PHP on CentOs

Maxwell

New member
Joined
Mar 5, 2013
Messages
397
Points
0
I've just bought a new VPS for checking, just want to know what are your easy ways to setup Apache, MySQL, PHP on CentOs?

Any tips
 

ironcladservers

New member
Joined
Jul 11, 2014
Messages
18
Points
0
Easiest way? Probably set up XAMPP @ apachefriends.org

Other than that you can use CentOS standard packages to install PHP/MySQL and such things, using 'yum' for example.
 

yestyle

New member
Joined
Jul 1, 2012
Messages
189
Points
0
I've just bought a new VPS for checking, just want to know what are your easy ways to setup Apache, MySQL, PHP on CentOs?

Any tips
Hello Maxwell, I installed and configured for a vps in the past hence I can give you easy tips to setup what you need, follow my instructions
First, you need to nstall Apache then type the follow command
Code:
sudo yum install httpd
after running for a while it will ask you "want to install package?", press Y and Enter.
restart Apache with code
Code:
sudo service httpd start
Install MySQL for CentOS 6
Code:
sudo yum install mysql-server
Restart Mysql
Code:
sudo service mysqld start
Now you need to set password for MySQL with command:
Code:
sudo /usr/bin/mysql_secure_installation
Enter current password for root (enter for none):
Type your password to make changes

Install Php and MySQL, you type these codes
Code:
sudo yum install php php-mysql
Restart server for PHP
Code:
Sudo service httpd restart
Ok you finished installations for LAMP (Linux, Apache, MySQL, PHP).
You need to have 2 these codes to run services automatically when rebooting
Code:
sudo chkconfig httpd on 
sudo chkconfig mysqld on
Hope it helps :)
 

Maxwell

New member
Joined
Mar 5, 2013
Messages
397
Points
0
@yestyle, Thanks for the tips but after install mysql completely, I'd like to install database for it, how to do?
 

yestyle

New member
Joined
Jul 1, 2012
Messages
189
Points
0
yestyle
Ok, now you will login into mysql to create database
Code:
mysql -u root -p
Using your username and password
For example, you have database with information follow
Code:
Database Name: myblog
Database User: myusername
Database Password: mypassword
Create a databse
Code:
CREATE DATABASE myblog;
and creating database user
Code:
CREATE USER myusername;
Set password for my username above
Code:
SET PASSWORD FOR myusername= PASSWORD("mypassword");
Grant privileges to a database user
Code:
GRANT ALL PRIVILEGES ON myblog.* TO myusername IDENTIFIED BY 'mypassword';
Refresh your MySQL by command
Code:
FLUSH PRIVILEGES;
and finally, exit MySql
Code:
exit
You have your database name, username and password. It's easy for you to create/install blog or website with this database.
If you have any questions, let me know:)
Good luck!
 
Older threads
Replies
18
Views
6,357
Replies
5
Views
3,208
Replies
2
Views
2,010
Replies
6
Views
4,619
Replies
9
Views
5,849
Newer threads
Replies
2
Views
2,713
Replies
2
Views
2,791
Replies
2
Views
2,992
Replies
13
Views
4,679
Latest threads

Latest postsNew threads

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top