Jump to content

Help! I broke my web servers.

Go to solution Solved by Queasy Tiger,

Okay, I don't know how I did it...
But I got it working.
Now to deploy the sites!
Thanks to everyone for the help, it's much appreciated!

Hi all!
Okay, so I’m in a predicament and I need help.


I have a pair of ProLiant DL380’s which host my websites, web and cloud services.
My Apache server is the heart of it, enabling all of them, but I’ve recently run into a bit of a problem.
I am not skilled with Linux, or software for that matter, and while I can export to FTP, use simple commands and do some command line work, I focus mainly on harware.
So, I partnered with someone to write code, deploy virtual hosts, and maintain the apache server.
He is already a good friend, so he worked for nothing but the credit for his own site and services at www.csoftware.cf
He has unfortunately fallen on hard times over the last month, and eventually became unable to assist with my servers.
Unable to find someone else to help me who was willing to do it as a favour, I decided to take matters into my own hands, and learn how to make virtual hosts, and all of the other responsibilities that he had.
Big mistake.
My first mistake was not backing up the server files before performing a large change.
My second mistake was messing with it.

Now, I didn’t know about webmin until this happened, and I want to use that when I get this fixed I possible, but I need someone to teach me how to use it.
So, I tried adding a virtual host myself, the old fashioned way in the daunting command line, and in the process managed to break the virtual hosts, and cause the server to crash every time I log into it via ssh or SFTP.
I have all of my sites in /var/www/html backed up, however I haven’t the knowledge to re-deploy the apache server.
This is where I need help.
I need someone that knows enough about Linux, Apache, webmin, and web servers to help me get my services back up and running, and to teach me how to deploy and maintain my servers.
In return, I will offer a VPS with 2 virtual cores, 2-4GB of RAM (You choose), 50GB RAID 10 HDD storage, and unlimited internet bandwidth (Subjective to my broadband speed of 4mb/s download, 0.4mb/s upload.  Yes, it’s awful, but for database storage, ssh into linux, etc, it’s fine.)
If you need to know any more details about my problem, then please ask.  I’m kinda desperate.

My VM for the Apache server is running:
Debian 9.7.0
Apache 2.X

The server is virtualised with VMWare ESXI, which luckily I know how to use.

Thanks in advance!

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, mtz_federico said:

What changes did you made? what tutorials did you follow?

Okay let me try and remember.
The first thing I did was try and add a virtual host.  I used the .conf files in etc/apache2/sites-available as a base, and edited them for the new site, with the new domain.
I added an index.html in /var/www/html/www-websitename (/var/www/html contains folders labelled www-sitename)
Then I restarted Apache, and it didn't work.
I tried a few things, before looking on a random forum and finding someone saying that it might work if I removed /var/www/html, and just put the folders in /var/www.
The thread was dead, but I decided to give it a go anyway.

So I did that, and edited the config files accordingly.
Then, it crashed.
And when I tried to reload it, it worked until I navigated a webpage or accessed FTP.
Someone I know who kinda knows linux tried fixing it, and now one site works from all of my domains, but still crashes within 10 minutes of startup.

I am happy to do a fresh installation of Debian.

Link to comment
Share on other sites

Link to post
Share on other sites

The easiest thing that you can do is do a backup of your files, the ports, the added libraries ,etc and reinstall apache in a fresh installation of debian.

you could even try redoing it on a vm without moving anything on the other one

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, mtz_federico said:

The easiest thing that you can do is do a backup of your files, the ports, the added libraries ,etc and reinstall apache in a fresh installation of debian.

you could even try redoing it on a vm without moving anything on the other one

The issue is, I don't actually know how to set up virtual hosts on an apache server.  I can install apache, and get it working with my network, but making config files etc I can't do.
Also, what library files?
Is there something I missed when trying to make a virtual host before?

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, mtz_federico said:

Here is a tutorial that you can check for how to do virtualhost on apache in debian 

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-debian-8

 

Libraries are like plugins that you can use on apache for added functionality like caching websites on ram for faster access 

Thanks!
I'll check it out, in the meantime to anyone scrolling past, I would like to learn how to use Webmin if you are willing to teach.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Queasy Tiger said:

Thanks!
I'll check it out, in the meantime to anyone scrolling past, I would like to learn how to use Webmin if you are willing to teach.

Here is a video that I found about Webmin, I have not watched it but i recommend that yt channel

https://www.youtube.com/watch?v=szW1fJ-tf5Y

Link to comment
Share on other sites

Link to post
Share on other sites

VirtualHost.conf files can easily cause apache not to reload if you have bad syntax or configuration. 

 

In future, the REASON you have a sites-available and sites-enabled folder, is that you create your mysite.conf file under the available folder, then use a2ensite <mysite> to enable it, or a2dissite <mysite> to disable it. 

 

If you're doing a big change to a virtualhosts configuration file, then you should make a backup of it first (copy it) so you can roll back. 

 

You should look in your apache log file (/var/log/apache/error.log) and see what errors it's giving. 

Spoiler

Desktop: Ryzen9 5950X | ASUS ROG Crosshair VIII Hero (Wifi) | EVGA RTX 3080Ti FTW3 | 32GB (2x16GB) Corsair Dominator Platinum RGB Pro 3600Mhz | EKWB EK-AIO 360D-RGB | EKWB EK-Vardar RGB Fans | 1TB Samsung 980 Pro, 4TB Samsung 980 Pro | Corsair 5000D Airflow | Corsair HX850 Platinum PSU | Asus ROG 42" OLED PG42UQ + LG 32" 32GK850G Monitor | Roccat Vulcan TKL Pro Keyboard | Logitech G Pro X Superlight  | MicroLab Solo 7C Speakers | Audio-Technica ATH-M50xBT2 LE Headphones | TC-Helicon GoXLR | Audio-Technica AT2035 | LTT Desk Mat | XBOX-X Controller | Windows 11 Pro

 

Spoiler

Server: Fractal Design Define R6 | Ryzen 3950x | ASRock X570 Taichi | EVGA GTX1070 FTW | 64GB (4x16GB) Corsair Vengeance LPX 3000Mhz | Corsair RM850v2 PSU | Fractal S36 Triple AIO | 12 x 8TB HGST Ultrastar He10 (WD Whitelabel) | 500GB Aorus Gen4 NVMe | 2 x 2TB Samsung 970 Evo Plus NVMe | LSI 9211-8i HBA

 

Link to comment
Share on other sites

Link to post
Share on other sites

48 minutes ago, Jarsky said:

VirtualHost.conf files can easily cause apache not to reload if you have bad syntax or configuration. 

 

In future, the REASON you have a sites-available and sites-enabled folder, is that you create your mysite.conf file under the available folder, then use a2ensite <mysite> to enable it, or a2dissite <mysite> to disable it. 

 

If you're doing a big change to a virtualhosts configuration file, then you should make a backup of it first (copy it) so you can roll back. 

 

You should look in your apache log file (/var/log/apache/error.log) and see what errors it's giving. 

Good points, check the syntax and the log files

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/14/2019 at 12:39 PM, Queasy Tiger said:

Hi all!
Okay, so I’m in a predicament and I need help.


I have a pair of ProLiant DL380’s which host my websites, web and cloud services.
My Apache server is the heart of it, enabling all of them, but I’ve recently run into a bit of a problem.
I am not skilled with Linux, or software for that matter, and while I can export to FTP, use simple commands and do some command line work, I focus mainly on harware.
So, I partnered with someone to write code, deploy virtual hosts, and maintain the apache server.
He is already a good friend, so he worked for nothing but the credit for his own site and services at www.csoftware.cf
He has unfortunately fallen on hard times over the last month, and eventually became unable to assist with my servers.
Unable to find someone else to help me who was willing to do it as a favour, I decided to take matters into my own hands, and learn how to make virtual hosts, and all of the other responsibilities that he had.
Big mistake.
My first mistake was not backing up the server files before performing a large change.
My second mistake was messing with it.

Now, I didn’t know about webmin until this happened, and I want to use that when I get this fixed I possible, but I need someone to teach me how to use it.
So, I tried adding a virtual host myself, the old fashioned way in the daunting command line, and in the process managed to break the virtual hosts, and cause the server to crash every time I log into it via ssh or SFTP.
I have all of my sites in /var/www/html backed up, however I haven’t the knowledge to re-deploy the apache server.
This is where I need help.
I need someone that knows enough about Linux, Apache, webmin, and web servers to help me get my services back up and running, and to teach me how to deploy and maintain my servers.
In return, I will offer a VPS with 2 virtual cores, 2-4GB of RAM (You choose), 50GB RAID 10 HDD storage, and unlimited internet bandwidth (Subjective to my broadband speed of 4mb/s download, 0.4mb/s upload.  Yes, it’s awful, but for database storage, ssh into linux, etc, it’s fine.)
If you need to know any more details about my problem, then please ask.  I’m kinda desperate.

My VM for the Apache server is running:
Debian 9.7.0
Apache 2.X

The server is virtualised with VMWare ESXI, which luckily I know how to use.

Thanks in advance!

If you're not all that good with Linux, I may recommend installing Plesk Oynx, it's cheap, it's got a web interface, and it doesn't really suck.

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, mikegeek said:

If you're not all that good with Linux, I may recommend installing Plesk Oynx, it's cheap, it's got a web interface, and it doesn't really suck.

At £7.20 a month, I might be able to start using it once I get a new job.
Without a stable source of income however, I cannot afford even that small amount.  With that and College, I'm a bit stuck at the moment.
Thanks for the suggestion though, I had been looking at Plesk as an option but was unsure.
I'll definitely give it a go as soon as I can.

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, mikegeek said:

If you're not all that good with Linux, I may recommend installing Plesk Oynx, it's cheap, it's got a web interface, and it doesn't really suck.

How is Webmin compared to Plesk?
Because on lots of "Top 10 Cpanel alternative" lists it comes up as good, but the user interface makes my head spin.

Link to comment
Share on other sites

Link to post
Share on other sites

Honestly if you're going to continue doing this yourself I would just run LAMP or even better if you have a windows license, WAMP. cPanel and similar are good if you are reselling web hosting. It's enough to learn apache let alone learning linux when it isn't for a fun project - so I would err more towards windows / WAMP.

 

Unfortunately what you're offering in compensation is pretty close to free tiers from other companies - for what may end up being a lot of work / training. I would look at how much electricity to run those servers + their value and think about paying for hosting online. If it's just a few websites, you can get webhosting for $40/yr - which is way cheaper than most electricity bills.

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/20/2019 at 5:38 PM, Mikensan said:

Honestly if you're going to continue doing this yourself I would just run LAMP or even better if you have a windows license, WAMP. cPanel and similar are good if you are reselling web hosting. It's enough to learn apache let alone learning linux when it isn't for a fun project - so I would err more towards windows / WAMP.

 

Unfortunately what you're offering in compensation is pretty close to free tiers from other companies - for what may end up being a lot of work / training. I would look at how much electricity to run those servers + their value and think about paying for hosting online. If it's just a few websites, you can get webhosting for $40/yr - which is way cheaper than most electricity bills.

I do have a Windows Server 2016 licence, but I have tried using WAMP with no success.  Usually errors or things simply not working.
And that's the other thing, I do want to offer VPS hosting, free.
No, there is no profit to be made in it, but it's a hobby, and the amount of people that ask me for a site or VPS (Mostly family and friends) is staggering, so I really want to try and get it to work.
My parents pay the electricity bill luckily, so I don't lose anything either.
And I understand about what I'm offering being somewhat pitiful, but I have a DL380 g6, and a DL380 G5, so resources are kinda tight....

At the very least, I want to be able to host sites.  I cheat and use a drag and drop builder, but that's not the point.  I have 2 people who want digital portfolio's for their art in college, and i'm at a dead end...
I can't afford hosting, I got my servers for under £100.

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Queasy Tiger said:

I do have a Windows Server 2016 licence, but I have tried using WAMP with no success.  Usually errors or things simply not working.
And that's the other thing, I do want to offer VPS hosting, free.
No, there is no profit to be made in it, but it's a hobby, and the amount of people that ask me for a site or VPS (Mostly family and friends) is staggering, so I really want to try and get it to work.
My parents pay the electricity bill luckily, so I don't lose anything either.
And I understand about what I'm offering being somewhat pitiful, but I have a DL380 g6, and a DL380 G5, so resources are kinda tight....

At the very least, I want to be able to host sites.  I cheat and use a drag and drop builder, but that's not the point.  I have 2 people who want digital portfolio's for their art in college, and i'm at a dead end...
I can't afford hosting, I got my servers for under £100.

What problems were you having with WAMP? By default you just drag your website into the wwwroot folder and it works. I ran it for a little while and might be able to at least help you with that. Though I would need to do a little bit of light reading to refresh myself on apache virtual hosts but I don't remember it being overly complex. 

 

For VPS and resources I would consider creating docker containers for those people (assuming they're looking for linux environments) to help you save on resources and something fun to learn.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...
On 5/22/2019 at 1:44 PM, Mikensan said:

What problems were you having with WAMP? By default you just drag your website into the wwwroot folder and it works. I ran it for a little while and might be able to at least help you with that. Though I would need to do a little bit of light reading to refresh myself on apache virtual hosts but I don't remember it being overly complex. 

 

For VPS and resources I would consider creating docker containers for those people (assuming they're looking for linux environments) to help you save on resources and something fun to learn.

 

 

Hi, sorry for the late reply.  Been busy.
With WAMP, I just have difficulty figuring things out.  I think it's because I'm having to use Windows, which I hate, even though I have to use it.
You see, I have autism, and some things are just easy and some are just hard, and it's hard to learn new things for me, so, since I have a little experience with Apache on Debian, I am going to try setting it up again with tutorials and such.
I do want to use webmin and virtualmin too.
And I have heard of docker, but I don't know what it is or how it works, or what it does.
I think the first thing I'm going to do is get the Apache server up and running before I get into the VPS issue.  I might even scrap that idea all together.

I just wish there is someone out there who would partner with me to do it.
Once I have the sites back up, I will start advertising that I'm looking for partners I think.

Thanks for the help though

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Queasy Tiger said:

Hi, sorry for the late reply.  Been busy.
With WAMP, I just have difficulty figuring things out.  I think it's because I'm having to use Windows, which I hate, even though I have to use it.
You see, I have autism, and some things are just easy and some are just hard, and it's hard to learn new things for me, so, since I have a little experience with Apache on Debian, I am going to try setting it up again with tutorials and such.
I do want to use webmin and virtualmin too.
And I have heard of docker, but I don't know what it is or how it works, or what it does.
I think the first thing I'm going to do is get the Apache server up and running before I get into the VPS issue.  I might even scrap that idea all together.

I just wish there is someone out there who would partner with me to do it.
Once I have the sites back up, I will start advertising that I'm looking for partners I think.

Thanks for the help though

If you go the Debian route take a look at LAMP then - all packaged together nicely for you.

 

Dockers are a "container" - almost the literal defintiion of the word. Like a shoebox inside your closet - it is inside your closet (linux) yet it is its own space (container).

 

What is nice about containers is when you want something like apache + SQL, somebody has already pre-made a shoebox/container for you to use. However there is a bit to learn about containers and understanding the limitations of it. 

 

The reason it is so useful is to save on system resources - why build a closet for every single shoebox, when you can fill an entire closet up with 200 shoeboxes? It's like building a VM for every single web server - really a waste of resources (though sometimes desired for security).

 

Apache out of the box shouldn't require any configuration if you're going to access it internally and on the same subnet. Should be able to drop your website into the root and roll on. For external access you have to edit the config file - I'd have to google to remember honestly.

 

 

I can setup an ubuntu server and setup LAMP for you, zip it, and throw it on the cloud for you. Only caveat is trust in my work and honesty - but if nothing else it could serve as an example. I can throw webmin and virtualmin default installs on there too. I use vmware so it will be in VHD/VSX format.

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Mikensan said:

If you go the Debian route take a look at LAMP then - all packaged together nicely for you.

 

Dockers are a "container" - almost the literal defintiion of the word. Like a shoebox inside your closet - it is inside your closet (linux) yet it is its own space (container).

 

What is nice about containers is when you want something like apache + SQL, somebody has already pre-made a shoebox/container for you to use. However there is a bit to learn about containers and understanding the limitations of it. 

 

The reason it is so useful is to save on system resources - why build a closet for every single shoebox, when you can fill an entire closet up with 200 shoeboxes? It's like building a VM for every single web server - really a waste of resources (though sometimes desired for security).

 

Apache out of the box shouldn't require any configuration if you're going to access it internally and on the same subnet. Should be able to drop your website into the root and roll on. For external access you have to edit the config file - I'd have to google to remember honestly.

 

 

I can setup an ubuntu server and setup LAMP for you, zip it, and throw it on the cloud for you. Only caveat is trust in my work and honesty - but if nothing else it could serve as an example. I can throw webmin and virtualmin default installs on there too. I use vmware so it will be in VHD/VSX format.

I use VMware too.  ESXI on my servers, so that would be nice if you could.
I know however, that I do need to learn to do it myself.
What I'll do, is use that to get my necessities running to begin with, while I try to fix my own.
If you could do that for me, it would be much appreciated. 
Thanks :)

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Queasy Tiger said:

I use VMware too.  ESXI on my servers, so that would be nice if you could.
I know however, that I do need to learn to do it myself.
What I'll do, is use that to get my necessities running to begin with, while I try to fix my own.
If you could do that for me, it would be much appreciated. 
Thanks :)

quick question, what domain name do you want to use? I was going to use mine but thought it would be easier to set it for yours. If you don't want it on the forums feel free to PM it to me.

Link to comment
Share on other sites

Link to post
Share on other sites

So having not touched webmin in many many years, little different install than before - easier since you can just install it via their repository. Funny story, got webmin installed and moved on to virtualmin (never used it before)... virtualmin includes webmin.

 

You run literally 2-3 commands on your server and you'll have virtualmin and webmin going - so I don't think you'll need me to upload the VM lol.

Log into your server, run:

wget http://software.virtualmin.com/gpl/scripts/install.sh
chmod 777 install.sh
./installsh

 

and follow the prompts - voila basic install done. After that you'll just need to run through the web GUIs and configure virtualmin. 

 

**Note - I couldn't remember what it was to make a file executable so being the lazy bastard I am I just chmod 777 the script - being it isn't a directory I felt it won't hurt anything.

Link to comment
Share on other sites

Link to post
Share on other sites

To get apache / mysql / phpmyadmin I used: https://www.linode.com/docs/web-servers/lamp/install-lamp-stack-on-ubuntu-18-04/

 

boils down to:

sudo apt update && sudo apt upgrade
sudo apt install tasksel
sudo tasksel install lamp-server

 

After that, you just configure apache how you want. The link I posted suggests you make a couple edits for performance, and then gives you an example of setting up a website - however with webmin installed you can do that from there once you have LAMP going.

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...
On 5/30/2019 at 9:49 PM, Mikensan said:

quick question, what domain name do you want to use? I was going to use mine but thought it would be easier to set it for yours. If you don't want it on the forums feel free to PM it to me.

 

On 5/30/2019 at 11:12 PM, Mikensan said:

So having not touched webmin in many many years, little different install than before - easier since you can just install it via their repository. Funny story, got webmin installed and moved on to virtualmin (never used it before)... virtualmin includes webmin.

 

You run literally 2-3 commands on your server and you'll have virtualmin and webmin going - so I don't think you'll need me to upload the VM lol.

Log into your server, run:


wget http://software.virtualmin.com/gpl/scripts/install.sh
chmod 777 install.sh
./installsh

 

and follow the prompts - voila basic install done. After that you'll just need to run through the web GUIs and configure virtualmin. 

 

**Note - I couldn't remember what it was to make a file executable so being the lazy bastard I am I just chmod 777 the script - being it isn't a directory I felt it won't hurt anything.

 

On 5/30/2019 at 11:31 PM, Mikensan said:

To get apache / mysql / phpmyadmin I used: https://www.linode.com/docs/web-servers/lamp/install-lamp-stack-on-ubuntu-18-04/

 

boils down to:


sudo apt update && sudo apt upgrade
sudo apt install tasksel
sudo tasksel install lamp-server

 

After that, you just configure apache how you want. The link I posted suggests you make a couple edits for performance, and then gives you an example of setting up a website - however with webmin installed you can do that from there once you have LAMP going.

Okay, sorry for not being active on the forum.
My dad is a writer-director and I've been helping him on his latest project. 
Anyway.

Thanks for the help, but I think I've decided how I'm gonna do it.
I think I'm gonna just use a basic Debian OS, and set up everything manually.
At least until i find a better solution.
Thanks though!

Link to comment
Share on other sites

Link to post
Share on other sites

Okay, I don't know how I did it...
But I got it working.
Now to deploy the sites!
Thanks to everyone for the help, it's much appreciated!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×