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

sohom

Supreme Member
Joined
May 26, 2013
Messages
1,361
Reaction score
646
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
 
Last edited:
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.
 
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
 
Last edited:
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.
 
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.
 
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.
DlYTs0E
 
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.
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
 
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.
DlYTs0E

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
 
Good share, but it is missing the vt scan :p
 
Good share, but it is missing the vt scan :p
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
 
Last edited:
Oh yes :p
I think you mean virustotal scan.
ya I totally forgot it ,since it was opensource.

anyway here the test result :
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
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. :)
 
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. :)

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
 
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
Gotcha. Vultr seems to have an affordable Linux vps plans. The cheapest one comes with the following.
bofp8HF

Is that okay for 1-2 sites sites?
 
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
Thank you. I'll do so.
 
@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
 
@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)
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:
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
I contacted them but they said that their panel is not yet integrated with Linux VM.
 
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.

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
 
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

Lots of good information here thank you for the share. What are the benefits of this way compared to standard web hosting with cPanel?
 
Lots of good information here thank you for the share. What are the benefits of this way compared to standard web hosting with cPanel?

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
 
Last edited:
Back
Top