Requirments: VPS, Go Daddy, Rackspace, etc.
Note: if VPS needs to be destroyed and rebuilt set pw first via Server Admin Panel.
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
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
A PuTTY Security Alert will pop up, click yes
Upgrade server after build or Destroy and Rebuild:
sudo yum update && yum upgrade
Note: hit y or yes when prompted when adding services
This is a good read Nano Basics
sudo yum install nano
Install Apache HTTP Server:
sudo yum install httpd
sudo apachectl start
This is a good read Top 20 OpenSSH Server Best Security Practices
Note: Change uname with your un and change config settings or uncomment as needed
sudo nano /etc/ssh/sshd_config
Add to last line of config file:
service sshd restart
Setup root privileges for your un or another admin
Create new user:
sudo /usr/sbin/adduser newuser
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.
Change permissions: add new user below root
root ALL=(ALL) ALL newuser ALL=(ALL) ALL
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
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
sudo nano /var/www/sitename/html/index.html
Add below code block
<html> <head> <title>www.website.com</title> </head> <body> <h1>Success: You Have Set Up a Virtual Host @website.com.</h1> </body> </html>
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> ServerAdmin webmaster@website_name.com DocumentRoot /var/www/website_name/html ServerName website_name ServerAlias http://www.website_name.com http://website_name.com www.website_name.com website_name.com </VirtualHost>
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.
Apache Web Site
systemctl status httpd.service -l
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
Navigate to File/Site Manager and insert server credentials
Note: Go Daddy accounts only support passive FTP.
Run following commands in Putty terminal.
sudo yum install mysql-server sudo service mysqld start
Set root pw.
Answer yes to options.
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
service httpd restart
Test PHP install, create PHP file.
sudo nano /var/www/html/info.php
Add bellow code block to file.
<?php phpinfo(); ?>
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.