Amar Pratap
Amar Pratap

Reputation: 1018

Installing cPanel on LAMP VM instance on Google cloud Compute engine

I have successfully installed LAMP stack on my VM of compute engine. I also installed VestaCP which is generally great but I want to install cPanel. I tried but failed.

Upvotes: 1

Views: 2374

Answers (2)

Lewis
Lewis

Reputation: 4595

Like Amar said, you have to set the rules. I ripped the cPanel firewall table using jQuery so these aren't manually typed. Google makes you create separate rules for inbound/outbound (ingress/egress), so here are the ones I had to make.

inbound-tcp

tcp:20;tcp:21;tcp:22;tcp:25;tcp:26;tcp:53;tcp:80;tcp:110;tcp:143;tcp:443;tcp:465;tcp:783;tcp:993;tcp:995;tcp:2077;tcp:2078;tcp:2079;tcp:2080;tcp:2082;tcp:2083;tcp:2086;tcp:2087;tcp:2095;tcp:2096;tcp:3306;tcp:6277;tcp:24441;

outbound-tcp

tcp:20;tcp:21;tcp:25;tcp:26;tcp:37;tcp:43;tcp:53;tcp:80;tcp:113;tcp:443;tcp:465;tcp:873;tcp:2077;tcp:2078;tcp:2079;tcp:2080;tcp:2089;tcp:2195;tcp:6277;tcp:24441;

inbound-udp

udp:53;udp:465;udp:783;udp:6277;udp:24441;

outbound-udp

udp:53;udp:465;udp:873;udp:6277;udp:24441;

Upvotes: 0

Amar Pratap
Amar Pratap

Reputation: 1018

Well, At last I have got cPanel installed and run successfully, thanks to Jason McDonald. Here are the steps if someone may need. Assuming you have LAMP installed and running (You may refer Complete Steps to installed LAMP on VM!)

cd ..

wget -N http://httpupdate.cpanel.net/latest

sh latest

After CPANEL is finished installing (an hour or so later), Enter the following command:

/scripts/configure_firewall_for_cpanel

FYI: wwwroot is now: /usr/local/apache/

Enter the following command to connect local to public IP:

 /scripts/build_cpnat

Someone else may have a better solution for this, however when you sign up for Compute Engine it doesn't allow you to specify the root password. When you try to login to WHM for the first time, it asks for the root password. So entered the following commands to change the root password:

 passwd root

Then change the password to what you want.

You will then need to allow the firewall connections that are required by WHM and CPANEL. I got this working via command line, however it was much more fool-proof using the Google Cloud website.

a. go to https://console.developers.google.com/project

b. click on your project

c. under Compute on the left, click on Compute Engine, then click on Networks.

d. Click "default" at the top

e. Click "NEW FIREWALL RULE" (Each time you create a rule, it won't bring you back to the previous screen, it just sits there. I had to hit the back arrow, and then hit New Firewall rule again. The previous rule I just made was still in the input text fields, I just changed it to the next rule I wanted to add, hit the back button, and kept doing this until I was done.) I would keep in mind for the future that you will have to do this for any port that you wish to because almost all are closed by default (i.e. using port 3306 for Remote MYSQL

Do the following, replacing with each of the following ports. You have to do each port separately, you can't list all the ports at the same time. Do this for ports 2082,2083,2086,2087,2089,2095,2096. (For reference, all ports used by CPANEL are herehttp://cpanel.net/getting_the_most_out_of_your_systems_firewall/)

  • Hit New Firewall Rule.
  • Name: allow-
  • Description: (I left blank)
  • Source Filter: IP Ranges
  • Source IP Ranges: 0.0.0.0/0
  • Allowed Protocols OR PORTS:
  • Target TAGS: (I left blank)
  • Hit the "CREATE" button
  • Hit the Back arrow to go back to the list.
  • Hit New Firewall Rule.
  • If the old text is still there, you can change only the Name and the Allowed Ports box to the port number you want to add. Hit the "CREATE" button again, hit the back button, and repeat.

After this you should be able to go to https://:2087 and login to WHM.

Upvotes: 1

Related Questions