Virtual Private Server LAMP Stack Setup using Putty and Centos 6 on Go Daddy VPS using Windows

Requirments: VPS, Go Daddy, Rackspace, etc.

Note: if VPS needs to be destroyed and rebuilt set pw first via Server Admin Panel.

Centos 6 Server Setup

Log into Go Daddy Products/Servers/Manage/Acces create or change pw.

Navigate to account/Servers/Manage copy primary IP address

Navigate back to product page Domains/Manage/Select Domain/Select DNS Zone File make sure IP match, if not edit Points To with correct IP

Download Putty and Install Download Putty

Using Putty Putty

Launch Putty

Insert IP address into text field, Port 22 in Port field and add a session name to text field/hit save, click Open

Navigate back to Go Daddy/My Products/Servers/Manage, copy Username

Navigate back to putty terminal and enter or paste Username only, hit Enter

Putty Warning

A PuTTY Security Alert will pop up, click yes

Insert pw

Upgrade server after build or Destroy and Rebuild:

sudo yum update && yum upgrade

Note: hit y or yes when prompted when adding services

Install Nano:

This is a good read Nano Basics

sudo yum install nano

Install Apache HTTP Server:

sudo yum install httpd

Start Apache

sudo apachectl start

SSH Setup

This is a good read Top 20 OpenSSH Server Best Security Practices

Basic Setup

Note: Change uname with your un and change config settings or uncomment as needed

sudo nano /etc/ssh/sshd_config
PermitRootLogin no

Add to last line of config file:

AllowUsers uname

Uncomment Line:

Protocol 2

Restart sshd

service sshd restart

Setup root privileges for your un or another admin

Create new user:

sudo /usr/sbin/adduser newuser

Create Password:

sudo passwd newuser

Change permissons of new user to root privileges:

This is a good read Using Vi

Note: Vi editor must be used for this task.

sudo /usr/sbin/visudo

Change permissions: add new user below root

root      ALL=(ALL)        ALL
newuser   ALL=(ALL)        ALL

Restart Apache

sudo apachectl restart

Create test website page

Note: change server_name with your server name.

Make directory to serve files to the www.

sudo mkdir -p /var/www/sitename/html

grant ownership:

sudo chown -R apache:apache /var/www/sitename/html

read our new files: enable public access your site

sudo chmod 755 /var/www/sitename/html

create file:

sudo nano /var/www/sitename/html/index.html

Add below code block

  <h1>Success: You Have Set Up a Virtual Host</h1>

Edit httpd config file

sudo nano /etc/httpd/conf/httpd.conf


#NameVirtualHost *:80 and uncomment

Find: change example to your website name



DocumentRoot "/var/www/html" change to your directory where files will be served from DocumentRoot "/var/www/server_name/html


<Directory "/var/www/html"> change to correct file path e.g. "/var/www/server_name/html"

Add below code to bottom of httpd.conf file. Change website with your website and server name.

<VirtualHost *:80>
  DocumentRoot /var/www/website_name/html
  ServerName website_name

Setting Up the Local Hosts

Run below command.

sudo nano /etc/hosts

Add your IP address and website name to last line of file, sample below

Restart httpd service with below command.

sudo /etc/init.d/httpd start

Trouble Shooting Install

If httpd service does not start, run below command and check error messages. Also, I would check Apache version, 2.2 or 2.4. There is a difference in the /etc/httpd/conf/httpd.conf file set up.

systemctl status httpd.service -l
Apache Web Site

sftp using FileZilla

I had major problems getting filezilla to transfer files to server directory. The only thing I could think of is that even though it is a VPS, it is still shared. I had to set permissions of the directories that will be serving up web files to accept file uploads using the below commands. Also the below commands don't allow for file delete. Add a d to rwx if you want to enable that type of admin permission. Also you might have to run same command's on www directory, and server name directory.

Note: It is my experience, do not run below commands below www directory or you will lose permissions and have to destroy and rebuild server!

Set permissions to upload permissions:

sudo setfacl -m u:username:rwx -R /var/www/server_name/html

Run second command for permissions:

sudo setfacl -m username -R /var/www/server_name/html

Download FileZilla

Navigate to File/Site Manager and insert server credentials

Note: Go Daddy accounts only support passive FTP.

Install MySQL

Run following commands in Putty terminal.

sudo yum install mysql-server
sudo service mysqld start

Set root pw.

sudo /usr/bin/mysql_secure_installation

Answer yes to options.

Install PHP

Run following commands in Putty terminal.

sudo yum install php php-mysql

Install PHP common modules, type following command

yum install php-common php-cli php-devel php-fpm php-gd php-imap php-intl php-mysql php-process php-xml php-xmlrpc php-zts

Restart httpd

service httpd restart

Test PHP install, create PHP file.

sudo nano /var/www/html/info.php

Add bellow code block to file.


Navigate to that file in web browser.

Remove file from server for security and save to your local machine. You can use this file to find needed PHP information for future builds.

© 2018 Camero Jones