1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice
  2. The hosting section is sponsored by Hostwinds visit the BHW Partnership program for your exclusive BHW member hosting benefit today.
    MUST be signed into your BHW account.
    Dismiss Notice

Script to auto Install : Apache,MySQL,Php,PhpMyAdmin,Kubuntu-Desktop, Wordpress,SSL on Ubuntu Server

Discussion in 'Web Hosting' started by sohom, Jan 20, 2019.

  1. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,015
    Likes Received:
    195
    Occupation:
    Coder
    Location:
    WWW
    Open Source Github Project/Repository URL :
    https://github.com/mediabots/ubuntu_-_lamp-kubuntu_desktop-wordpress-ssl

    A Shell Script to Auto install LAMP(Apache,MySQL,Php),PhpMyAdmin,Kubuntu Desktop,Wine,Wordpress,SSL Certificate on Ubuntu 18.04/Bionic O.S.

    If you are using an older version of Ubuntu like 16.04, then Remote Desktop(XRDP) facility would not work for you.

    With Kubuntu-desktop, the script would also install WINE package to run Windows Apps on your Linux system.

    SSL would be verified by letsencrypt.org and initially it would provide a 3 month Certificate. Certificate would be auto renewed in every 60 days by "CertBOT" app, which also would be installed in your system


    Requirements


    A SSH client such as putty

    A VPS or Dedicated server with Ubuntu 18.04(preferred) OS Installed

    Either should have access of root user OR run with su(super user)


    How to Run the Script


    Code:
    su
    
    wget https://raw.githubusercontent.com/mediabots/ubuntu_-_lamp-kubuntu_desktop-wordpress-ssl/master/mediabots_ui.sh
    
    chmod +x mediabots_ui.sh
    
    ./mediabots_ui.sh
    If you opt for Kubuntu-Desktop installation, then it would take around 1 hr 15 mins to complete all the process.

    Otherwise, it would take more or less 10 minutes.


    Conclusion


    Script would take care of all common issues of Wordpress installation, such as : Directory & User Permission, Redirection/Rewrite rules, .htaccess, etc.

    Script would create an individual directory for each domain name such as : / var/ www/ html/ YourDomainName

    And it would also create an individual host file for each domain name such as : / etc/ apache2/ sites-available/ YourDomainName.conf

    That offers you to add the unlimited number of websites in your Server.

    SSL for your domain name would be automatically renewed by the CertBOT. So you don't have to worry about that thing too.

    In short, this script could save lot of time & effort :D


    Demo Video



    OR
    http://bit.ly/Shell-Ubuntu

    --
    Hope you guys like it.
    If you are a developer, you are welcome to contribute in the project

    Feel free to ask any question
    Don't forget to share your thoughts


    Thank you
     
    • Thanks Thanks x 13
    Last edited: Jan 20, 2019
  2. kasumi009

    kasumi009 Regular Member

    Joined:
    Feb 4, 2017
    Messages:
    236
    Likes Received:
    53
    Gender:
    Male
    Location:
    Kouga Manjidani
    Such a sweet share, thanks buddy. How can you add other domain names? I know this one is a dumb question but i never hosted any website that way.
     
    • Thanks Thanks x 1
  3. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,015
    Likes Received:
    195
    Occupation:
    Coder
    Location:
    WWW
    Welcome bro.

    It is ok, no question is dumb, all need to be start from some point.

    You can add any number of wordpress/site on your single Server/VPS IP

    All you have to have latest script from
    Code:
    https://raw.githubusercontent.com/mediabots/ubuntu_-_lamp-kubuntu_desktop-wordpress-ssl/master/mediabots_ui.sh
    And run it repetitively; make sure to give different database name for each time (it would be asked under advanced setting)
    ---------------------------------------------------------------------------------
    If you want to do it manually , without using any script.
    it can be done by adding individual host-file for each of you domain.

    Suppose , your 1st site name is site1.com and 2nd site name is site2.com

    so under / var/www/html Directory , there should be 2 folder with your site names :-
    site1.com
    site2.com

    Then under / etc/apache2 /sites-available/ Directory, there you should add .conf host-file for each domain name.
    eg,
    site1.com.conf & site2.com.conf

    content of site1.com.conf would be :
    Code:
    <Directory / var/www/html/site1.com>
    AllowOverride All
    </Directory>
    <VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName site1.com
    DocumentRoot / var/www/html/site1.com
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>
    
    PS-
    remove the space between '/' and 'var' [I have to add that space,otherwise BHW would not allow to post that code]

    So, as like you can see "DocumentRoot" of the host-file would take of your domain path

    after that run these below line of codes ;
    Code:
    sudo a2ensite site1.com.conf
    sudo systemctl reload apache2
    sudo a2dissite 000-default.conf
    sudo systemctl reload apache2
    sudo a2enmod rewrite
    sudo systemctl restart apache2
    
    from above, a2ensite saying to enable the site1.com host-file
    a2dissite saying to disable default host-file.
    Since you are planning to host multi sites, 000-default.conf would not be useful nymore.

    do repeat above steps for your 2nd domain : site2.com and so on

    Regards
     
    • Thanks Thanks x 1
    Last edited: Jan 21, 2019
  4. kasumi009

    kasumi009 Regular Member

    Joined:
    Feb 4, 2017
    Messages:
    236
    Likes Received:
    53
    Gender:
    Male
    Location:
    Kouga Manjidani
    Thank you infinitely. I got a separate 5 bucks windows vps that would be for this only. How many websites it could possibly host? Let's say each website get 1k-10k visitors on a daily basis. I'm thinking of getting a Linux vps since they sound cheaper though.
     
  5. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,015
    Likes Received:
    195
    Occupation:
    Coder
    Location:
    WWW
    you are welcome :)

    keep in mind , above example of host-file is for Apache serer. For nginx server, setting is bit different.
    If you want to use the script, in Linux OS, choose Ubuntu 18.04 or 16.04
    and make sure , that you have su (super user) password

    if you don't ,just add your sites manually.
    Don't forget, vps is different than shared hosting.
    In VPS you would not have name server like ns1 , ns2.
    You would have VPS IP in this case. To access your site you have to setup DNS 'A' record for your domains.

    Since your sites are getting average 5k traffic/day.
    So say, each user consuming 5MB bandwidth(expecting you host any image/video in 3rd party site)
    Therefore 25 GB bandwidth(BW) for each day for a single site.
    750GB BW / month for each site.

    With 1 TB BW , you could't host more than 2
    With 10 TB BW , you could host more than 10 sites.
     
    • Thanks Thanks x 1
  6. kasumi009

    kasumi009 Regular Member

    Joined:
    Feb 4, 2017
    Messages:
    236
    Likes Received:
    53
    Gender:
    Male
    Location:
    Kouga Manjidani
    I see. Looks like i got the whole thing the wrong way and tried to make it work the with a windows vps and here's what i got. lol.
    [​IMG]
     
  7. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,015
    Likes Received:
    195
    Occupation:
    Coder
    Location:
    WWW
    Yes, I aw your last reply , where you said, you bought a windows VPS.

    Script would only work on Linux OS : Ubuntu 16.04 or 18.04
    And iff you have root access or su
     
  8. nirose

    nirose Senior Member

    Joined:
    Oct 24, 2008
    Messages:
    1,092
    Likes Received:
    462
    Location:
    theyre.onto.us
    You need to purge the windows VM and ask the host to install a Ubuntu VM. most host have this ability to easily configure on their control panel. if not just ask the host.

    If you have never heard of Ubuntu, it's best to learn it first. It can be headache inducing to start by learning to install a website over ssh on your first day if something goes wrong
     
    • Thanks Thanks x 1
  9. Gogol

    Gogol Jr. VIP Jr. VIP

    Joined:
    Sep 10, 2010
    Messages:
    4,655
    Likes Received:
    4,226
    Gender:
    Male
    Occupation:
    Programmer
    Location:
    Pale Blue Dot
    Home Page:
    Good share, but it is missing the vt scan :p
     
    • Thanks Thanks x 1
  10. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,015
    Likes Received:
    195
    Occupation:
    Coder
    Location:
    WWW
    Oh yes :p
    I think you mean virustotal scan.
    ya I totally forgot it ,since it was opensource.


    [Full .zip package]
    Code:
    https://www.virustotal.com/#/url/ab4dcfd101b95ba6979311fd3071f1f83ef2b3deaad73a098e908965b9bebf00/detection
    target url :
    Code:
    https://github.com/mediabots/ubuntu_-_lamp-kubuntu_desktop-wordpress-ssl/archive/master.zip
    ------------------------------------------------------
    [.sh script only]
    Code:
    https://www.virustotal.com/#/url/ce6d37c0d31653894a7678a9b1ce59b420dfa1365a5995661627301a6099ccd9/detection
    target url :
    Code:
    https://raw.githubusercontent.com/mediabots/ubuntu_-_lamp-kubuntu_desktop-wordpress-ssl/master/mediabots_ui.sh
    Thank you
     
    • Thanks Thanks x 1
    Last edited: Jan 23, 2019
  11. Gogol

    Gogol Jr. VIP Jr. VIP

    Joined:
    Sep 10, 2010
    Messages:
    4,655
    Likes Received:
    4,226
    Gender:
    Male
    Occupation:
    Programmer
    Location:
    Pale Blue Dot
    Home Page:
    Yeah, may be a vt scan of the file (download the zip and scan it may be) would be more appropriate.

    Btw, the script seems to be very handy indeed. I will test it out very soon. :)
     
    • Thanks Thanks x 1
  12. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,015
    Likes Received:
    195
    Occupation:
    Coder
    Location:
    WWW
    Yes
    thank you again for reminding me :)
    my last post edited.

    yes, I hope you would found it useful.
    in case any any problem , I would be happy to help.

    Regards
     
    • Thanks Thanks x 1
  13. kasumi009

    kasumi009 Regular Member

    Joined:
    Feb 4, 2017
    Messages:
    236
    Likes Received:
    53
    Gender:
    Male
    Location:
    Kouga Manjidani
    Gotcha. Vultr seems to have an affordable Linux vps plans. The cheapest one comes with the following.
    [​IMG]
    Is that okay for 1-2 sites sites?
     
  14. kasumi009

    kasumi009 Regular Member

    Joined:
    Feb 4, 2017
    Messages:
    236
    Likes Received:
    53
    Gender:
    Male
    Location:
    Kouga Manjidani
    Thank you. I'll do so.
     
  15. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,015
    Likes Received:
    195
    Occupation:
    Coder
    Location:
    WWW
    @kasumi009
    that 2.5/month plan not including any IP (ipv4) address.
    And an IP address is essential for your site setup.

    So better go with $3.5/month plan (which includes an ipv4)

    Also https://www.vultr.com giving opportunity to pay for hourly basis.
    So if you want to upgrade/downgrade a plan , just create backup, delete current server & create/deploy a new one from backup image/snapshot

    Also you can try (iff you can follow their TOS)
    https://www.scaleway.com/pricing/
    or
    https://www.digitalocean.com

    Thanks
     
  16. kasumi009

    kasumi009 Regular Member

    Joined:
    Feb 4, 2017
    Messages:
    236
    Likes Received:
    53
    Gender:
    Male
    Location:
    Kouga Manjidani
    I see. But they say that it comes with ipv6. Won't that do the job? Or maybe it should be ipv4 as you mentioned.
     
    Last edited: Jan 23, 2019
  17. kasumi009

    kasumi009 Regular Member

    Joined:
    Feb 4, 2017
    Messages:
    236
    Likes Received:
    53
    Gender:
    Male
    Location:
    Kouga Manjidani
    I contacted them but they said that their panel is not yet integrated with Linux VM.
     
  18. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,015
    Likes Received:
    195
    Occupation:
    Coder
    Location:
    WWW
    ok, possible.
    then at the time of your domain DNS setup, use ''AAAA' record for IPv6
    Because, AAAA records are IPv6 address records which map a host name to an IPv6 address.
    where "A" record used for ipv4 address

    Here is a Namecheap Advanced DNS setup Tutorial :
    https://www.namecheap.com/support/k...an-i-set-up-an-a-address-record-for-my-domain

    Regards
     
    • Thanks Thanks x 1
  19. magicjones

    magicjones Junior Member

    Joined:
    Oct 10, 2018
    Messages:
    181
    Likes Received:
    68
    Gender:
    Male
    Lots of good information here thank you for the share. What are the benefits of this way compared to standard web hosting with cPanel?
     
    • Thanks Thanks x 1
  20. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,015
    Likes Received:
    195
    Occupation:
    Coder
    Location:
    WWW
    You are Welcome :)

    did you mean , what are the benefits of VPS/Cloud/Dedi hosting over shared hosting?

    cPanel comes with a price/month (through cPanel alternative : webmin,centos-webpanel are free)

    Shared hosting often comes with restriction such as:
    limited number of Domains ,limited number of MySQL database,etc

    in vps you can install any packages

    in vps you could choose OS

    vps usually comes with greater disk-space & bandwidth

    resource(ram,cpu) are not shared

    Now, it is obvious, if you are planning to to open a reseller hosting, then one should go with cPanel/WHM or DirectAdmin
    But if some one just want to host few websites or want to start a wordpress hosting site for business, then panel is not necessary. Because that Shell Script could take care of little things.

    Regards
     
    • Thanks Thanks x 1
    Last edited: Jan 23, 2019