Installing cPanel on LAMP VM instance on Google cloud Compute engine - cpanel

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.

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.

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;

Related

Expected a valid shop query parameter

I'm trying to create new Shopify app using shopify-app-cli, I set up all redirect links and .env file, but when I run Shopify serve and when it says Ready on http://localhost:8081, I go to localhost page and it shows this error: Expected a valid shop query parameter.
What does it mean?
I checked my .env file for maybe typos, but everything is copied fine.
That mean you have miss yourshopname.myshopify.com . This needed when you authenticated your app.
https://yourshopname.myshopify.com/admin/oauth/authorize?client_id='your_api_key'&scope='your_scopes_require'&redirect_uri='your_redirect_url'
For more information read here
in my case the problem was in Safari, it's worth checking in Chrome
Had the same error; was able to fix it by going to url mentioned after shopify create was executed:
Run shopify serve to start a local server
Then, visit
https://partners.shopify.com/<ACCOUNT-ID>/apps/<APP-ID>/test to
install on your Dev Store
see: https://github.com/Shopify/shopify-app-cli/issues/201#issuecomment-620286966
This can be a problem with ngrok URL or a third-party service in your Shopify app blocking the connection.
1-
You'll need to set up your app in the partners dashboard with the ngrok URL you get from Shopify server, ex:
https://ea6214072ff3.ngrok.io
https://ea62d4072ff3.ngrok.io/auth/callback
Check this github issue or this blog-post for more info.
2-
In case you're using a third-party's server like MangoDB in your app, you need to change your DNS server address (some ISPs cram as many DNS’s as possible).
I will be using Google's DNS 8.8.8.8 in this example:
Linux:
If you are connected to a WiFi network click on the “Wi-FI” tab.
Otherwise, if you have a wired connection click on the “Network”
tab.
Select the connection for which you want to set the DNS nameservers
and click on the cog icon to open the Network Manager.
Select the IPv4 Settings tab.
Disable the “Automatic” toggle switch and enter the DNS resolvers IP
addresses 8.8.8.8
Clear (Flush) the DNS cash (required for Ubuntu 18.04^) follow this article
Windows:
Control Panel and select Network and sharing center.
Click on Change adapter settings.
right-click on Local Area Connection and then select Properties.
select the option Internet Protocol Version 4 (TCP/IPv4) and then click on properties.
Choose the radio button Use the following DNS server addresses and enter the 8.8.8.8 value in Preferred DNS server:
Clear (Flush) the DNS cash follow this article

Apache2 Not Responding: Bitnami Magento Install (Legacy)

For reasons too insane to even go into, I am attempting to install using the Bitnami Magento 1.9.2.4 image on a fresh Amazon AWS/Lightsail Ubuntu 16.04 instance (2gbs to avoid complaints and be sure I don't run into anything unnecessary).
I think this is really more of an Apache question. After I finish the install (success), I can't get the server to respond via the instance IP address at the default port (8080).
Regarding the old Bitnami Image, you can get (or wget) that Magento 1.9.2.4 image still, it's over here:
wget "https://downloads.bitnami.com/files/stacks/magento/1.9.2.4-3/bitnami-magento-1.9.2.4-3-linux-x64-installer.run"
So for the sake of anyone who's trying to work through the whole process, once you pull the above down to your instance you need to chmod the above file to 755. This assumes you are in the directory with your download:
chmod 755 bitnami-magento-1.9.2.4-3-linux-x64-installer.run
Then run it using it's full path, like:
/home/ubuntu/bitnami-magento-1.9.2.4-3-linux-x64-installer.run
So the install is going to ask a bunch of questions, for anyone keeping track my answers were all yes (ie. yes to Git, PhpMyAdmin, Beetailer... whatever that is).
Then I created an admin user / password etc.
As far as the port I didn't have anything running on 8080 so the install defaulted the port to 8080 with HTTPS on 8443 with MySQL on 3306 (more on ports in a minute).
I think Host/Domain is one of the keys to this problem. When I couldn't get the server to respond I just recreated an instance and tried a different Domain during the install process. I tried: internal AWS IP, External ACTUAL IP, 127.0.0.1
Here's what the Magento 1.9 Domain prompt looks like:
So basically that sort of brings us up to date.
Once I finished the install, like a normal human used to using bitnami as a cloud image I assumed the server would respond at whatever the default path was at the IP address it was running on. Ie:
BASEIPADDRESS:8080/magento
Not the case. When I hit that the server does NOT respond, hence the question. In addition to the above I have also tried the BASEIPADDRESS, and the BASEIPADDRESS:8080
Results checking open ports
So since the server is not responding I figured I would check the ports.
First I checked using netstat:
netstat -lntu
I got back:
Then I realized that netstat is now depreciated... so I went with:
ss -lntu
I got back:
(excuse the images, formatting wouldn't work for text)
To me it looks like 8080 (default) is open in both of those results. So why isn't the server responding at the default location?
#Bitnami Status = OK
Checking the status with:
/home/ubuntu/magento-1.9.2.4-3/ctlscript.sh status
Everything looks good:
apache already running
mysql already running
Memcached not running
Since it says Memcached was not running, I started memcached to see if that was the issue, no it was not.
I can access the instance via SSH and yes I am sure the IP is right. See images above.
I also posted this to the Bitnami community but haven't heard anything over there. Will cross populate as I get ideas.
It looks to me that you configured Magento using the private IP address, so you would not be able to access from your browser. A way to check it is by executing the following command in your machine:
curl -L 127.0.0.1:8080/magento
If that provides output, then the IP is misconfigured, so you would need to reinstall using the proper IP
So this ended up being PRIMARILY due to not running the Bitnami stack installer as root / sudo:
sudo /home/ubuntu/bitnami-magento-1.9.2.4-3-linux-x64-installer.run
Why Install with Sudo on AWS/Lightsail?
So the reason you need to install as sudo has to do with the fact that when run as the normal user (ie. not root) the installer defaults to port 8080 which is NOT open on aws by default. To complicate matters further you may not be able to get things running properly even if you manually swap to port 80 AFTER you run the installer.
To avoid a scenario where port 80 requires root access to utilize I just re-created my instance and ran the installer as root with the above command.
Host Setting
During install I selected the public IP for the "Host" prompt and everything worked as I thought it might (straight out of the box).
Thanks to Javier Salermon who put me on the right track and the devs at Bitnami for cueing me into the fact that 8080 is not open by default.

Troubleshooting "The service “ipaliases” appears to be down." In WHM

Background
Last night I was having some trouble with my server when I added a new IP address. I tried but could not get it routed in my WHM. In the beginning I tried adding it from the,
Show or Delete Current IP Address menu of WHM.
I created a new Cpanel Account and chose the IP as the dedicated IP for that account. When I could not get it routed I took three steps,
1. I released it from the account
2. Released the IP from the server (AWS)
3. Deleted the account
Then I tried to delete it from the WHM menu mentioned above. When I try to delete it I get this same message over and over again,
Since then I have routed a new IP and everything started working fine. But I cannot remove the old IP still. Now to top that off I have received this high priority message in my email from WHM
Question
I am wondering if these two things are related and I can not come up with a way to troubleshoot this.
What are the proper steps I can take to safely remove the IP address that shows inside of the Show or Delete Menu
When making configuration changes to the server at some point I changed the server's main IP address for a brief time. This made WHM think the main IP was the one that I was unable to delete 10.0.1.175. In order to resolve this I followed these steps,
1. I ran the /scripts/mainipcheck script to make sure that the main network interface was mapped to the proper IP.
2. Once that resolved the issue I ran the /scripts/build_cpnat scrip just to make sure that all private IP addresses were mapped to the proper external IP addresses.
At this point I was able to remove the IP address that was not part of my network and everything continued to work as normal.

Installing Apache on Windows for manual use and multiple users

I installed Apache HTTP Server on our Windows system, to work on a home project; it's for use by "localhost" only. When I installed it, the two options were to install it as a service, for all users, using port 80; or to install it for just the current user, run manually, using port 8080. I selected the second. However, while I'd prefer for it to use port 8080 and be run manually, I'd like it to be set up so that my wife can run it as her user. (Allowing all users would be OK.) I don't see an httpd.conf entry for this. Is there a way to do this either through httpd.conf or a command-line option? I'm guessing I could do this in the registry but I don't want to mess with it if I don't have to. (P.S. There's no need to have multiple instances run simultaneously.)
There's nothing you can do from within httpd.conf; any settings in there affects the server itself and not how it is accessed by a program
Well, you have a few options:
1. Uninstall the software and re-install it choosing the all users option. That would be your best choice.
2. Found the location of the folder where it was installed (or where apache.exe is located as that is the needed file to run) and see if you can create a shortcut link into it from within your wife's account. Apache server doesn't care who runs it as long as that file can be executed. The problem you might face is Windows OS preventing you from running it, especially if it requires administrative rights.
3. Install a software such as WAMPServer for her. Of course, that means two similar software on the same machine.
If I have to do it, I would go the first route. Every other option is gonna be a little complicated to work with.
Hope the explanation is clear and the answer helps.

Stop password prompt on MAMP startup

I develop using MAMP pro on my Mac. When I start MAMP it prompts me for a password if I use port 80. If I use a higher port it doesn't prompt me, but I have to append the port number in the URL ( eg dev.local:8888 ).
Does anyone know how to make it not prompt for password when using standard ports?
Thank you.
I've put together an app that allows you to start/stop MAMP's Apache and MySQL without the password request, even on port 80. It stores the password in Keychain, so you only need to enter it once. It has a nice icon too!
Download: http://www.46palermo.com/blog/run-mamp-without-password-easy-way/
According to a living-e rep they are considering adding an option to store the password in the keychain:
http://forum.webedition.de/phpBB/viewtopic.php?f=4&t=5517&p=12019
Update: I pestered Living-e support and got them to add it as a feature request to their bug tracker. The link is here: http://qa.living-e.de/tracker/view.php?id=3648 (requires registration) if you want to follow it.
Another update: Still following this issue. Looks like living-e moved their bug tracker, the new link to this issue is:
http://bugs.mamp.info/view.php?id=3652
It's in German but the Google translation is:
When will start and stop the server in
each case the admin password is
required if port is used as low-1024th
If we could get the password from the
OS X Keychain / keyring, allowed
themselves to avoid annoying popup
ads.
Or a German speaker's translation is:
When the Server starts/stops it will ask for the admin password each time.
If it could get the password from OS X Keychain / Keyring, the annoying popup could be avoided.
As found on Macworld and already mentioned by Tom in the other answer there is a way with applescript! Downside is you have to save your user credentials in plain text.
Open AppleScript Editor
Enter the following code replacing YOURPASSWORD and YOURUSERNAME with your user credentials
Save it as application. You might tick run-only to prevent other users from reading the plain text as a small security measure
do shell script "/Applications/MAMP/bin/startApache.sh &" password "YOURPASSWORD" user name "YOURUSERNAME" with administrator privileges
do shell script "/Applications/MAMP/bin/startMysql.sh > /dev/null 2>&1"
There might be an issue with the correct file path as MAMP apparently changed startmySQL.sh to startMysql.sh in some version, so double check if it's not working!
You can put the new application in the Login Items (System Preferences -> Users & Groups -> Login Items), so the Apache server and MySQL start automatically without even showing up the MAMP-App at startup (silent start).
In response to the commands that were posted:
1) Run MAMP on port > 1024
Running all of the servers on MAMP (nginx, apache, mysql) with port ranges above 1024 allows the Mac OS X account you logged in with to launch the services, so you will not be asked for a password in this instance. Any server that runs below port 1024 requires root privileges when being executed.
2) chmod -R a+w /tmp
This command would recursively go through all files and sub folders in /tmp and make them writable for the current user. When MAMP launches, servers create temporary files in this directory.
Also if you decide you want to run the servers below port 1024 and want a solution with applescript that does not store the password in plain text then see this link applescript password with keychain
I'm now using these two applescripts to start/stop MAMP, you can save startup script is a login item so it's always up when I boot. It does mean storing your password in plain text, as Im the only one using this machine I can live with it, better than typing in my password at least three times a day.
I bind apache to port 8080 and then use port forwarding from 80 to 8080
sudo ipfw add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in
Works for me, but I'm working on making the above script permanent. So far, nothing I've tried sticks, so I just run the command above in terminal after restarting. But you can then freely start and stop MAMP without a password and use a URL without :8080 or :8888.
Its a security issue, and MacOS with its UNIX heritage like security (=Good Thing). That's why MacOS asks for passwords all the time. Not much you can do about it as far as I know.
1) Run MAMP on port > 1024
2) chmod -R a+w /tmp