Skip to content

Instantly share code, notes, and snippets.

@EmadAdly
Last active November 17, 2022 06:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save EmadAdly/1772e7f29bb8066cc5cec90cde768981 to your computer and use it in GitHub Desktop.
Save EmadAdly/1772e7f29bb8066cc5cec90cde768981 to your computer and use it in GitHub Desktop.
Setup bitnami lamp stack point domain and vhost
## Point Domain to Amazon Web Services (AWS) EC2 Instance
1. Open the Amazon Route 53 console at [https://console.aws.amazon.com/route53/](https://console.aws.amazon.com/route53/).
2. If you are new to Amazon Route 53, you see a welcome page; choose **Get Started Now** for **DNS Management**. Otherwise, choose **Hosted Zones** in the navigation pane.
3. Choose **Create Hosted Zone**.
4. For **Domain Name**, type your domain name.
5. Choose **Create**.
6. Click the Hosted Zone, edit record set.
7. In the value, add `ec2-**-***-***-**.compute-1.amazonaws.com.` or your IP
8. Change your DNS file to point to the IPv4 address (This would be in something like GoDaddy).
Note: There is no difference if you ec2 or lightsail are both the same settings.

1- First clone demo app

sudo cp -r /opt/bitnami/docs/demo /opt/bitnami/apps/yourApp

2- Update vhost to your data

sudo nano /opt/bitnami/apps/yourApp/conf/httpd-vhosts.conf

<VirtualHost *:80>
    DocumentRoot "/opt/bitnami/apps/yourApp/httpd"
    ServerName yourApp.com
    ServerAlias *.yourApp.com
    DocumentRoot "/opt/bitnami/apps/yourApp/htdocs"
    Include "/opt/bitnami/apps/yourApp/conf/httpd-app.conf"
</VirtualHost>

3- Update httpd Directory

<Directory "/opt/bitnami/apps/yourApp/htdocs">
    Options Indexes MultiViews
    AllowOverride All
    <IfVersion < 2.3 >
    Order allow,deny
    Allow from all
    </IfVersion>
    <IfVersion >= 2.3>
    Require all granted
    </IfVersion>
</Directory>

4- Add vhost to apache config

sudo nano /opt/bitnami/apache2/conf/bitnami/bitnami-apps-vhosts.conf

add this line to bitnami-apps-vhosts.conf file

# Bitnami applications installed in a Virtual Host
Include "/opt/bitnami/apps/yourApp/conf/httpd-vhosts.conf"

5- Restart appache

sudo /opt/bitnami/ctlscript.sh restart apache

your vhosts is ready to redirect domain to your app, Just one step left point domain to yourApp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment