Jump to content

Setting up IPB on AWS?


Recommended Posts

It’s just like any other blank server. You just need to setup services like Apache, PHP, etc. 

I made a script to help me automate setting up a web server that could run IPB. (I had MySQL, Redis, etc running elsewhere.)

Quote

# Switch to using PHP 8

sudo amazon-linux-extras install epel -y

sudo amazon-linux-extras enable php8.0

sudo yum clean metadata

# Update the operating system

sudo yum update -y

# Install PHP

sudo yum install php php-{pear,devel,cgi,common,curl,mbstring,gd,mysqlnd,gettext,bcmath,json,xml,fpm,intl,zip,gmp} httpd httpd-tools mod_ssl gcc certbot lynx libc-client-devel uw-imap-static openssl-devel unison -y

# Fix libc

sudo ln -s /usr/lib64/libc-client.a /usr/lib

# Set Apache groups/ownership

sudo chkconfig httpd on

sudo usermod -a -G apache ec2-user

sudo chown -R ec2-user:apache /var/www

sudo chown -R ec2-user:apache /var/www/html

sudo sed -E -i -e 's/User apache/User ec2-user/' /etc/httpd/conf/httpd.conf

 

# Install php-imap from source since it is not in the RPM directory for PHP8

getphp=`rpm -q --queryformat="%{VERSION}" php`

wget https://www.php.net/distributions/php-${getphp}.tar.gz 

tar xzvf php-${getphp}.tar.gz

cd php-${getphp}/ext/imap

phpize

./configure --with-kerberos --with-imap-ssl

make

cd modules

sudo cp imap.so /usr/lib64/php/modules/

echo 'extension=imap' | sudo tee -a /etc/php.d/30-imap.ini 

rm -rf ~/php* 

# Install Redis support into PHP

printf "\n" | sudo pecl install redis

echo 'extension=redis.so' | sudo tee -a /etc/php.d/30-redis.ini

# Set Apache httpd.conf and php.ini directives

sudo sed -i '/<Directory "\/var\/www\/html">/,/<\/Directory>/ s/AllowOverride None/AllowOverride all/' /etc/httpd/conf/httpd.conf

sudo sed -E -i -e 's/upload_max_filesize = 2M/upload_max_filesize = 8M/' /etc/php.ini

sudo sed -E -i -e 's/memory_limit = 128M/memory_limit = 256M/' /etc/php.ini

sudo sed -E -i -e 's/disable_functions =/disable_functions = exec,passthru,shell_exec,system,popen,proc_open/' /etc/php.ini

sudo systemctl restart httpd

You’ll need to use SES or another SMTP service as AWS blocks those ports to EC2.

The above would be run via SSH from the ec2-user account. 
 

Link to comment
Share on other sites

Great! Do you use lightsail? How do you run SSH in AWS. They use so much shorthand that I've never come across. If you can be as detailed as possible... I'm pretty slow. Thanks a million.

EDIT: Also what if I just wanted to host on amazon?

Edited by Serathy
Link to comment
Share on other sites

I've never used Lightsail.  But from what I read, it runs on the same platform as EC2 and is just a stripped down version of it.  If you DO use Lightsail, you would want to make sure to choose just the Amazon Linux 2 OS template  (not a LAMP instance) if you're going to use the script above.  If you're going to use one of their LAMP stacks, you will want to need to confirm it meets all of the system requirements as I don't know if it has all of the required PHP modules.  

If you're not familiar with SSH, I would suggest Google for some tutorials and videos.  There are plenty out there.  I don't know what OS you're using, but the following guide has some info:

https://www.clickittech.com/aws/connect-ec2-instance-using-ssh/

 

Also there is no such thing as just "hosting" on Amazon.  If you're not comfortable managing a web server, database server, etc...  you're most likely better off not using AWS.  There is no technical support and if/when something goes wrong...  you're on your own.  

For example changing from PHP7 to PHP8...  if you don't know what you're doing and how to upgrade it, how are you going to maintain it long term?  

If you don't know anything about managing servers, SSH, FTP, etc...  you might want to consider having IPS host it for you with one of their cloud offerings.  

Link to comment
Share on other sites

On 1/22/2023 at 1:53 PM, Serathy said:

Great! Do you use lightsail? How do you run SSH in AWS. They use so much shorthand that I've never come across. If you can be as detailed as possible... I'm pretty slow. Thanks a million.

EDIT: Also what if I just wanted to host on amazon?

I'll give you a quick highlevel of my sites (I have multiple hosted on the same AWS server)

I'm not AWS genius and wanted to dip my toes in the water with hosting my websites in AWS.

Previous hosting was LiquidWeb VPS (so I had WHM/cPanel).  LiquidWeb was fantastic and the advantage of LiquidWeb over AWS is they supply instant support (via ticket or calling 24x7) so if you aren't so savy on maintaining a server, they are fantastic but only if you get the "managed" service which obviously cost more.

Now knowing all that..  I cheated a bit...  I created my AWS Console account, selected Lightsail and choose the WHM/cPanel version (since its what I'm familar with).  You will need to purchase a cPanel license (if you don't already have one) and register it to the static IP you set on your Lightsail instance.  Its pretty cheap (like $10 or something)...

Once its all booted up I logged into WHM (https://staticIPaddress:2087) and ran the option: Transfer which when you click on transfer you provide the IP address of your old WHM server, root and password.  After that.. it transfers everything and updates everything from old IP to new IP.  it was so darn easy.  It transferred all the emails, settings..   I mean, it couldn't of been easier.

Then I transferred my domains from Google Registrar to Route53 (Amazon DNS) not that you have to but since my crap is business I just one one bill that I can charge my customers.

Only hiccup I had was email.  I added the ports to my Lightsail Firewall but still issues sending emails from by IPS board...  so I leveraged sendgrid API which works great but is limited to 100 emails for the free account which I don't think will be an issue.

Hope that helps..  again, its high level but I was very impressed.  Previously I did the EC2 instance because I wanted to load all my own software and have my control but honestly it was a headache for me personally.  Using lightsail was WAY easier...  if you already have a WHM/cPanel you want to transfer everything from.

NOTE: if you do the transfer of WHM/cPanel note that it will disable your account on the old box.  There may be a setting to not do this but it was fine for me since the websites never even went down.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
×
×
  • Create New...