How to create a website in Ajenti (Configure PHP website)
Create a website in Ajenti
Ajenti is a web-based control panel which is used widely for server management tasks and Ajenti V is a plugin used with Ajenti to create and configure multiple websites.In the previous post, we learned how to install and configure Ajenti and Ajenti V plugin on our EC2 instance.In this post, we look into how to create a website in Ajenti control panel.
Prerequisites – Ajenti, Ajenti V , NGINX, Mysql , PHP (php-fpm7.0, mysql, php7.0-mysql)
In case you didn’t already installed these packages follow this post.
Steps to create and configure a website in Ajenti.
Step 1 – Open your browser and browse to www.yourdomain.com:8000 (ajenti is installed on port 8000 by default) and log in to your ajenti control panel. On the left sidebar click on websites option.
Now you will be redirected to a page where you can see all your previous websites , In the new website section, enter the name of the website and click on create.
Step 2 – After clicking on create you can see your website in the websites section.Click on the manage button beside the name of the website to configure the website and you will be redirected to the website configuration page as shown below.
Step 3 – We will go through all of these tabs one by one to configure the website. On general tab uncheck the maintenance mode and in the Website Files section we have to enter the path to the website folder, for the sake of simplicity, we will enter example as the name (we will create this folder later).Click on set after entering the name and then click on fix file permissions and finally click on apply changes to save the changes.
Step 4 – We will move on to the next tab which is domains. In this tab, we will enter the domains on which we want to configure the website, make sure your domain is pointed to the EC2 instance IP. Click on Add button and enter your domain make sure you enter both versions of your domain one with www and one without www and click on apply changes.
Step 5 – Next on the ports tab don’t change anything and click on apply changes and move on to next tab which is SSL, if you have SSL certificate enter the path to the certificate in this tab and click on apply changes.
Step 6 – On content tab from the dropdown list select PHP 7.0 Fast CGI and click on create and then click on apply changes to save.
Step 7 – Move on to the Advanced tab and on this tab, you can add your custom configurations for the website, for example, your redirects, URL rewrite etc, for this tutorial we will keep it blank and press apply changes and for the rest of the tabs i.e Processes and MySql we don’t need to change anything.
Step 8 – Now we are done with all the settings but we still need to upload our website files so for this tutorial I am using this simple file index.php shown below.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Our Awesome Website</title> </head> <body> <?php echo "Welcome to our awesome website"; ?> </body> </html>
Now on the left toolbar click on file manager and select srv than create a new folder and rename it to the name you have given earlier in the path field while setting up the website in my case it was example.Open example and upload your files here.
After uploading the files you can browse to your website domain and see your website.If you face any problem comment on this post and I will be happy to help!
Have a good day!