Tutorial

Creating a Website and an Email Account on Ajenti V

Creating a Website and an Email Account on Ajenti V

Introduction

Ajenti is an open source, web-based control panel that can be used for a large variety of server management tasks. The add-on package called Ajenti V allows you to manage multiple websites from the same control panel. By now you should have Ajenti and Ajenti V installed.

In this tutorial we will setup a basic website using Ajenti V from the Ajenti control panel and create an email account on your website’s domain.

Prerequisites

For this tutorial, you will need:

Configuring your Domain

So far, https://panel.your_domain_name:8000/ opens the Ajenti control panel. Before we can setup your website at http://your_domain_name/ and configure email addresses for your domain, there are a few DNS modifications that need to be made.

We need to add 2 records to make sure your website and email addresses work properly. Go to cloud.digitalocean.com/domains/ and click on the domain name you configured when setting up the Ajenti control panel and Ajenti V.

If you haven’t already, add an A record for the entire domain by filling out “@” in the HOSTNAME field, and selecting your Ajenti server or fililng out its IP address in the WILL DIRECT TO field. Click the Create Record button to add this initial A record. If panel.example.com is not yet configured for your domain, repeat the above steps again, but use “panel” instead of “@” for the hostname.

Next, select the MX record type. In the HOSTNAME text box, enter @. In the MAIL PROVIDERS MAIL SERVER, enter your domain name. In the PRIORITY text box, enter 10. Click the Create Record button to add the record.

If you are configuring the same domain that has the Ajenti control panel on it, you also need to add a TXT record. For instance, if you access Ajenti on panel.example.com, you should add this record. If you access it on panel.otherdomain.com, you do not need to add the TXT record.

To add the TXT record, select the TXT record type. In the HOSTNAME text box, enter @. In the VALUE text box, paste this in: v=spf1 a ip4:your_server_ip ~all (replacing the IP with your server’s IP). Click the Create Record button.

Your domain DNS settings should now look like this. Your specific domain will vary:

Example DNS Settings

Creating the Website Directory

In your browser, browse to https://panel.example.com/ and log into Ajenti. In the sidebar to the right, under the Web section, click Websites. The first time it may give you a notice that it is not active yet. Click the Enable button to allow Ajenti V to make the necessary config changes.

There is a section called New Website. Under that there is a Name text field. You can type anything you want to identify your website with in this field. Click the Create button, and you will notice your website is now listed under the Websites section at the top of the page. Click Manage next to your website.

Under the Website Files section, change /srv/new-website to any directory, for example /srv/example.com. Click the Set button, and then click the Create Directory button. Remember this directory. You will need to upload files to it soon.

Under the General tab, uncheck the Maintenance mode setting. Click Apply changes at the bottom of the page.

At the top of the page click on the Domains tab. Click the Add button, and type your domain name in the text field that appears. Click the Apply Changes button.

Creating/Uploading the Website Files

Now that you have a directory for your website files, you need some files to go in it.

Under the Tools section in the sidebar, click File Manager. Click on the folder names to navigate to the directory you created for the website files such as /srv/example.com. The folder should be empty. Here you can upload whatever files and folders you would like for your static website.

For the purposes of this tutorial, we are going to make a simple “Hello world!” document on the website. Click the New File button at the top of the screen. A file named new file should appear in the folder. At the end of the line for the file, click the menu button.

Click the Menu Button

In the Name field, change new file to index.html. Click Save, and open that same menu again. This time, click the Edit button to open a Notepad. The following text is an example of what you could enter to ensure your website is working. Of course, you can enter anything you’d like here instead.

index.html
<!DOCTYPE html>
<html>
<head>
  <title>This website is working!</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>If you can read this correctly, your website is functional!</p>
</body>
</html>

Click Save at the top of the Notepad, and the file will go live.

Repeat these steps as needed to build your website. You can also make use of the File Manager’s upload function. Back in File Manager, towards the bottom of the screen there is a button titled Choose File. You can click that and a normal prompt to choose a file from your computer to upload will appear. From here, any files you select will be uploaded to the site.

Browse to Your Website

Browse to your domain name such as http://example.com in your web browser. If you see the “Hello World!” page you made in the last step, everything works!

Hello, world!

You can choose to finish now or read on to create your own email account for your own domain.

Creating an Email Account

Now we will make an email account with your registered domain name.

Go to your Ajenti Control Panel. Under the Web section, click Mail. Click the Enable button if prompted. Under New Mailbox there are a few sections to fill out. The Address text box is whatever you want to come before the @ sign in your email address. If you enter sammy here, your email will be sammy@example.com. There is also a dropdown box to select a domain. If you have more than one website configured with Ajenti V, there will be multiple options here. Don’t put anything in the Custom domain field. After you’ve filled out this information, click + Mailbox.

As you can see, your new email address now appears under the Mailboxes section of this page. Click it, and then click the Change password link. Type a new password for your mailbox, press ENTER, and then click Apply Changes at the bottom of the screen.

Now click the Advanced tab at the top of the page. In the TLS section, check the box next to enable, then click the Generate new certificate button. After you’re done, click Apply changes at the bottom of the page. This increases security when connecting to your mailbox and increases compatibility with email clients.

To retrieve your email, you can connect with an email client (like Outlook, Thunderbird, K-9 Mail, etc.) or you can install RainLoop, a webmail program for accessing your mail in a browser in Ajenti.

To connect to this mailbox in an email client, the following information should be useful:

Username: user@example.com
Password: your_mailbox_password
IMAP Server: panel.example.com
IMAP Port: 143
IMAP Encryption: STARTTLS (Accept all certificates)
SMTP Server: panel.example.com
SMTP Port: 25
SMTP Encryption: None

Conclusion

You should now have a working email account and website for your domain name. They were both created within the Ajenti V Control Panel and can both be modified with the same control panel.

Check out Installing the RainLoop Email Client on Ajenti V if you want to learn how to install a web-based email client on your server.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products


Tutorial Series: Using the Ajenti Control Panel with Ajenti V

Ajenti is an open source, web-based control panel that can be used for a large variety of server management tasks. It can install packages and run commands, and you can view basic server information such as RAM in use, free disk space, etc. All this can be accessed from a web browser.

Optionally, an add-on package called Ajenti V allows you to manage multiple websites from the same control panel and easily configure email accounts for your domains.

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
10 Comments
Leave a comment...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Hello,

Thanks for your awesome tutorial i loved the way you do it ^_^.

I have a problem with the website path, I changed it to /srv/my_domain (Same domain with the panel.my_domain i added TXT records) and i clicked the Set button, and clicked the Create Directory button. However, For some reason the domain path is /var/www/html/ i tried to add new domain to try maybe i did something wrong, But i got the same problem!

Can you help me please ?

Thanks.

Tammy Fox
DigitalOcean Employee
DigitalOcean Employee badge
June 30, 2015

Hi Thear. Did you click Apply Changes at the bottom of the same page?

Hi Tammy, Yes i clicked it, I tried too many options and i ended to solve it like the way in this tutorial How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS

Tammy Fox
DigitalOcean Employee
DigitalOcean Employee badge
July 1, 2015

This comment has been deleted

    Tammy Fox
    DigitalOcean Employee
    DigitalOcean Employee badge
    July 1, 2015

    I’m glad you were able to solve the problem.

    Hi, …thanks for tutorial. I made setup of my 3 domains easily, but with mail settings, I am struggling few days. Followed by your example, nothing happens! Thunderbird cannot connect with mail server automatically or manually … Please help me to solve the problem.

    We might have the same problem. I can configure my email client to connect and use an unencrypted connection, but when trying STARTTLS it fails every time.

    You should check if port 25 is blocked, that was the problem with my ISP (Comcast).

    Also, when I was using Thunderbird with this is was a bit buggy, but Outlook 2013 and RainLoop worked like a charm, maybe try those?

    Looks like you’re right about Thunderbird jonaharagon. Perhaps a little more insight into the issue:

    SMTP protocol synchronization error (next input sent too soon: pipelining was not advertised): rejected "EHLO we-guess.mozilla.org" H=[xx.xxx.xx.xx] next input="QUIT\r\n"
    

    @bbbenji using that configuration you posted in your other comment:

    SMTP_PORT == 25:587
    LOCAL_INTERFACES == <; 0.0.0.0.25 ; 0.0.0.0.587 ; 0.0.0.0.465 ; [::0]:25 ; [::0]:587 ; [::0]:465
    

    Thunderbird seems to be working just fine now on my Ubuntu install, I just had to accept the invalid certificate exception of course, but otherwise it now sends emails. Thunderbird must be having some sort of issue with the unencrypted SMTP port.

    Followed the instructions precisely, I can access my Panel on https://panel.mydomain.tld. The issue standing is when accessing http://mydomain.tld, it’s not serving “index.html”. I’m not sure why, NGINX seems to be installed and working just fine. Any ideas? I’m receiving a 403.

    I also can’t connect to my email inbox, I’ve been at it for hours. I’ve allowed ports 25, 143, and 993 through my firewall for IMAP access. I receive the following error when trying to establish a connection – ConnectException: Connection refused

    I still can’t get nginx to serve my files, though I’ve added a static content rule. As far as the emailing, I’ve solved my issue by reinstalling courier-imap. My issue standing now with the mail server, is that I cannot send or receive anything. I can login using telnet and validate any mailboxes I’ve created, but that’s the extent of my access.

    You may have tried this, but try rebooting your droplet, otherwise it may need to be reinstalled. I’ve never heard of that NGINX problem before. Have you tried looking at the NGINX logs maybe? They’d be located in /var/log/nginx

    Regarding email: What email client are you using? I’ve seen success connecting vary dramatically between email clients, for instance Thunderbird doesn’t seem to work, but Outlook 2013 and RainLoop does.

    I got the 403 error is well. The problem was, when following the instructions, I did not put the index.html in srv/example.com/index.html folder.

    The mistake was putting the index.html file at srv/index.html

    I’ve been following the tutorials, (they are GREAT!), but I am having an issue. How do you make panel.my_domain.com go to Ajenti? (Currently, I’m getting in via my IP with :8000) I set up a website in Ajenti and installed Wordpress and my_domain.com goes to it–as it should–but I don’t know how to point that “panel” subdomain. Thank you!

    You should be able to access your Ajenti control panel at https://panel.example.com:8000 if you followed the first tutorial correctly.

    If not, click Configure in the sidebar, and under the HTTP Server section, you can change the host to panel.example.com. The port generally should be left as something other than 80, for both security and technical reasons (it can sometimes cause NGINX to fail).

    Why is there no, and how can I set up, encryption on SMTP. Is there a reason why you didn’t configure that?

    Actually, I don’t even believe it is an option to configure within the panel, which is a shame because it is a much needed feature.

    I have found, all that needs to be done to enable encryption on SMTP is to add the following 2 lines to “mail > advanced > custom configuration”

    LOCAL_INTERFACES == <; 0.0.0.0.25 ; 0.0.0.0.587 ; 0.0.0.0.465 ; [::0]:25 ; [::0]:587 ; [::0]:465```
    
    This opens up port 587 with encryption for SMTP.

    @bbbenji interesting. I’ve used the same configuration to open port 2525 on my setup, because 25 was blocked by my ISP, but I wasn’t aware that encryption on that port was working, and just needed to be opened.

    I’ll test that out and update this tutorial if I can, because encrypted SMTP would definitely be a better option.

    SMTP_PORT == 25:587
    LOCAL_INTERFACES == <; 0.0.0.0.25 ; 0.0.0.0.587 ; 0.0.0.0.465 ; [::0]:25 ; [::0]:587 ; [::0]:465
    

    its work use port 587 for SMTP (im not use any encryption) and i try send mail to gmail, outlook, yahoo. but just outlook.com not get my mail. something wrong from my config?

    @Sitihajar So your email is sending but outlook.com is the only service not receiving them? Perhaps they are going into spam? Do you get a bounce back message after attempting to send to outlook.com?

    yes, outlook.com is the only service not receiving. its not goin’ to spam and try to waiting for a day still not receive it. send to yahoo and it goin to spam, gmail have no problem

    when i try another setting yesterday, email is sending but i got error message “550 - relay not permitted” and outlook.com’s mail still not receiving

    @Sitihajar If it’s spam you’re worried about, try using www.mail-tester.com, it will give you suggestions on how to fix your emails going to spam :)

    @jonaharagon This is awesome tutorial

    i have problem when add mail. when click “Custom Domain” dropdown, there’s no domain available, just “custom domain”. if i add domain in custom domain field, is it ok? or there’s setting to show domain from dropdown?

    @irfan.hilmyyy Ok, so that means you didn’t set up a website with a domain. Either you do that and then it will show up, or you select Custom Domain and then type the domain manually in the Custom Domain field. Hope that helps!

    why there is no web section on my panel ?

    Make sure you followed Part 1 of my series, you should have installed Ajenti V during installation: https://www.digitalocean.com/community/tutorials/how-to-install-the-ajenti-control-panel-and-ajenti-v-on-ubuntu-14-04

    This comment has been deleted

      Hi, I followed the tutorial and looked everywhere, but when I install Ajenti V, I only get websites under the WEB tab, and not websites and mail. I’m not sure what I’m doing wrong. Any thoughts?

      Thanks,

      Imgur does your sidebar have this section?

      Join the Tech Talk
      Success! Thank you! Please check your email for further details.

      Please complete your information!

      Become a contributor for community

      Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

      DigitalOcean Documentation

      Full documentation for every DigitalOcean product.

      Resources for startups and SMBs

      The Wave has everything you need to know about building a business, from raising funding to marketing your product.

      Get our newsletter

      Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

      New accounts only. By submitting your email you agree to our Privacy Policy

      The developer cloud

      Scale up as you grow — whether you're running one virtual machine or ten thousand.

      Get started for free

      Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

      *This promotional offer applies to new accounts only.