Installing DirectAdmin on Google Compute Engine VM

ORiN

Verified User
Joined
Nov 27, 2010
Messages
55
Location
Singapore
I am exploring cloud solutions for a client and is exploring if it is possible to install DirectAdmin on Google's Compute Engine. Anyone with similar experience?

I figured that since the VM can run CentOS, I should be able to install DirectAdmin.
 
I have no experience with it. The purpose of my reply is to point out some of the issues you may run into:

1) does the instance stay connected? Are there any circumstances under which it could disappear? If so does any of its storage disappear with it? if so, then do you have a way to completely backup your virtual bare-metal system?

2) do you have pass through access to one or more static IPs? I seem to recall that Amazon has or at least had a problem with this. There was a workaround, but it may not be officially supported by DirectAdmin.

Perhaps you can give it a try and let us know.

Jeff
 
To answer your questions, the instance is supposed to stay connected as it is used to host some websites and a web application. My server admin is using a static IP for the VM.

Looks like my server admin will have to try on his own for now. I will report back with some of our findings.
 
It looks like Google Compute Engine has the same issues as Amazon even if the external IP is pointing to the network address. Given that cloud solutions are getting more and more common, this is extremely frustrating.
 
What does the word cloud mean to you?

The Google Compute Engine, just as the Amazon Web Service, is a specialized kind of cloud solution, designed for on-demand hosting. It's a solution in the cloud whre the word cloud refers to that good old standby most of us call the Internet.

Many software systems require pass-through IP solutions for license control. I recall reading a work-around which enables DirectAdmin to work on AWS, and the same might very well work with Google Comute Engine.

But I still consider them both specialized platforms for on-demand computing rather than solutions designed for hosting.

So what would I consider a cloud solution designed for hosting? A Dedicated Server. A VP Server.

That's just me. Your mileage may vary.

Jeff
 
I tried a few times to install DA on Google Cloud Platform Compute Engine. After a lot of Google search and this post. I looked up the workaround of DA to run on AWS. Since the two platforms are not configured in the same way this process was trial and error. So the success to install the script without connection errors was after. I first connected as root with the command:

Code:
sudo -s

Next, stop the Firewall
Code:
systemctl mask firewalld
systemctl stop firewalld

Then I followed on CentOS 7, xfs is used by default and Quotas are not activated, so you need to enable them manually
Code:
nano /etc/default/grub

add quota options rootflags=usrquota,grpquota into the end of GRUB_CMDLINE_LINUX line, it will look like this
Code:
GRUB_CMDLINE_LINUX="crashkernel=auto console=ttyS0,38400n8 rootflags=usrquota,grpquota"

Make a backup

Code:
cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.back

Generate a new configuration file:

Code:
grub2-mkconfig -o /boot/grub2/grub.cfg

Restart the server, the root directory will be mounted with required options. We can check by running this command

Code:
mount | grep '/'
Code:
/dev/xvda1 on / type xfs (rw,relatime,attr2,inode64,usrquota,grpquota)

Add network eth0:0

By default, GCP use private IP for eth0, to install DirectAdmin, we need to use the public IP

Code:
nano /etc/sysconfig/network-scripts/ifcfg-eth0:0

Enter the following content

Code:
DEVICE=eth0:0
BOOTPROTO=none
ONPARENT=yes
IPADDR=xxx.xxx.xxx.xxx
NETMASK=255.255.255.0
ONBOOT=yes

where xxx.xxx.xxx.xxx is your AWS Public IP, then restart the network

Code:
/etc/init.d/network restart

If you wish to you IPv6, set your eth0 live below:
Code:
IPV6INIT="yes"
IPV6ADDR=2600:1f16:xxxxxxxxxxxx

6. Setup DirectAdmin

Code:
echo 1 > /root/.lan
wget http://www.directadmin.com/setup.sh
chmod 755 setup.sh
./setup.sh
And follow the instructions. Note when you asked for the network, enter eth0:0
Configuration

Since GCP run on a LAN/NAT and behind the firewall, we need to do some config.

Enable LAN

Code:
nano /usr/local/directadmin/conf/directadmin.conf

Add this value lan_ip=yyy.yyy.yyy.yyy where yyy.yyy.yyy.yyy is your GCP Private IP
Link the Private IP to your Public IP using the DA Linked IP feature

  • Add the LAN IP to DA's IP manager. Don't assign it to any Users or Domains.
  • View the details of the external IP: Admin Level -> IP Manager -> Click the public/external IP.
  • Link the internal IP to the external IP: Select the LAN IP from the drop down.
  • Only select Apache, do not select DNS

Restart DirectAdmin

Open ports for FTP

I like to use (https://www.configserver.com/cp/csf.html) to manage my firewall settings on command line and via DA.

If you use ProFTPD, edit it's configure file:

Code:
nano /etc/proftpd.conf

Add after PassivePorts: MasqueradeAddress xxx.xxx.xxx.xxx where xxx.xxx.xxx.xxx is your AWS Public IP

Add rule to the iptables

iptables -I INPUT -p tcp --dport 35000:35999 -j ACCEPT

Code:
nano /usr/libexec/iptables/iptables.init

add $IPTABLES -A INPUT -p tcp --dport 35000:35999 -j ACCEPT below the ftp section, like this
Code:
#########################
# ftp
$IPTABLES -A INPUT -p tcp --dport 21 -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport 35000:35999 -j ACCEPT

I compile this how to from several different sites and merged them into one which I use get my instance running with DA. My only issue is I am not sure how fix any issues that maybe caused when the instance reboots. Both AWS and GCP reset the hostname to their system default. There is suppose to be a way to set this at boot but I think you have to make a bash script then call to it at boot using the execute script option on both cloud platforms.
 
Last edited:
i can't add quota. This is my /etc/default/grub
Code:
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial --speed=38400"
GRUB_CMDLINE_LINUX="crashkernel=auto console=ttyS0,38400n8 rootflags=usrquota,grpquota"
GRUB_DISABLE_RECOVERY="true"
but when check with mount | grep ' / ' then
Code:
[root@sv2 ~]# mount | grep ' / '
/dev/sda2 on / type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
 
Back
Top