1

I created all my php files and wants to put this to the public_html file on Linode (Ubuntu16.04LTS). How can i make my site live?

1 Answers1

1

First make sure you made a directory /var/www/html/MyDomain.com/public_html to house all your file as wanted.

NOTE: REPLACE MyDomain.com with your domain name as wanted

Assuming that you've setup the full LAMP on your server, here's what you need to do. Create a .conf file located at /etc/apache2/sites-available/MyDomain.com.conf.

NOTE: REPLACE MyDomain.com with your domain name as wanted

Then type command nano /etc/apache2/sites-available/MyDomain.com.conf to edit the file and paste this codes to it:

# domain: MyDomain.com
# public: /var/www/html/MyDomain.com/public_html

<VirtualHost *:80>
  # Admin email, Server Name (domain name), and any aliases
  ServerAdmin webmaster@MyDomain.com
  ServerName  MyDomain.com
  ServerAlias www.MyDomain.com

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /var/www/html/MyDomain.com/public_html
  # Log file locations
  LogLevel warn
  ErrorLog  /var/www/html/MyDomain.com/log/error.log
  CustomLog /var/www/html/MyDomain.com/log/access.log combined
</VirtualHost>

This is the default .conf file provided by Linode

Then type the command a2dissite *default to remove or disable the default apache2 and then type a2ensite MyDomain.com.conf to enable the site. Also, type service apache2 reload to make the site live.

AGAIN, TAKE NOTE TO REPLACE MyDomain.com with your domain

You might want to add the DNS zones to linode and add a slave IP.

Step 1: Login to Linode and Click DNS Manager and click add a domain zone. Then Provide these details:

Guide Photo

Step 2: Go to Linodes>YourLinode###>Remote Access and click reverse DNS. In then put your domain there and click Look up