New Virtualhosts load default site since Apache/Ubuntu upgrade - apache

I upgraded our web server from Ubuntu 12.04 to 14.04, which also upgraded Apache from 2.2 to 2.4.
The upgrade was successful and all existing virtualhosts are running great.
I created a new site yesterday and noticed that it was loading the default host instead of the one it should. I checked the .conf file in /etc/apache2/sites-enabled and it does look a little different than the other ones.
I understand that Apache 2.4 has some changes like "Require all granted" which shows in the new .conf file alongside the previous "allow from all". I tried commenting it out but that didn't do anything.
I guess I could try backing up this file and copying over an existing working .conf file and just modify the paths to see if that works - but having to do this for every new site I add in the future is not a solution.
Does anyone experience this during their upgrade process?
--- UPDATE ---
I looked again at the conf file and I noticed that all my other working conf files have 2 distinct differences:
They list the IP next to the port < VirtualHost 1.2.3.4:80 >, the broken one just had an asterisk *
They duplicate the < VirtualHost >, one for port 80, another for port 443
So I added the IP in the broken file in the <VirtualHost...> and duplicated the settings for port 443, restarted apache, and the site worked.
So now it comes down to where in the Virtualmin/Webmin settings would I make adjustments to fix this?

While creating, first option is which IP you want to bind you domain to. That is very IP you have defined against your domain DNS.
But that is only needed if you have bounded IP with port in your conf file.
By default its *:80. So no need to bind.

Related

XAMPP, Apache and IIS on the same machine

Im trying to run XAMPP on the same machine as IIS but I cant make apache work. I changed the ports to 8080 and 4333 but I still cant run it. If I stop IIS service, apache starts normally. Is there any way to make it work here?
thanks.
These should work together as long as not colliding on ports, I currently run both at same time myself, and have run into same pain you have. XAMPP Apache doesn't say which port, it just don't start.
I commented out all "443 Listen" & "NameVirtualHost *:443" entries - (with #) , and changed xampp sites to a non iis port (my case 86) in apache\conf\httpd.conf, but also be sure you check the config(s) in E:\xampp\apache\conf\extra. xampp has "extra" configs there.
Be sure to check that D:\xampp\apache\conf\extra\httpd-vhosts.conf is not set to use\listen on 443.
updating answer here a bit...
Actually you may just need to comment the Listen 443 line, (change to #Listen 443, or change to 4333 or what ever) in D:\xampp\apache\conf\extra\httpd-ssl.conf at about line 36 or so. The section in that file with ..
<VirtualHost default:443>
defined can just sit there unused if you dont need it then, so no need to comment that section out for now.
Sorry, that was actually my issue - I did this so long ago I forgot. Apache files are not set up the same way.
...
Basically there is a port conflict you need to clear up. also be sure you dont leave "copied" or "backed" up conf files with the .conf extension in the conf folders - sometimes those get grabbed and used. Good luck on your dup port Hunt.
... putting my comments here because they may be getting buried...
ok, just try commenting out any listen settings other than the one you need (8081) in the config files instead (httpd.conf, extra/httpd-ssl.conf & extra/httpd-vhosts.conf). You may be bumping into your own listen settings elsewhere in your conf files. one time i mistakenly set 443 in main httpd.conf and in ssl.conf. besides you might not need 443 at all anyway. the answer is in your conf files somewhere. perhaps a file contents search for "listen" in the /conf/ folder might help.
also you may want to check out the "netstat" button from xampp panel - it should tell you a bit more about what is using what ports, that sometimes gives good clues
And if you did not know or are new to xampp/apache VERY IMPORTANT
REMEMBER TO RESTART APACHE AFTER ANY CONF CHANGE !

How Can I Host Multiple Websites Under One Amazon EC2 Instance?

I've followed this guide to do this but I'm having no luck inspite of my incessant Googling. Any advice would be supremely appreciated.
https://nouveauframework.org/blog/vhosts-running-multiple-sites-on-a-single-aws-ec2-instance/
I've setup Hosted Zones for the respective domains I wish to host. I've linked them to my instance via A records pointing to the instance IP, as well as adding the new nameserver records to the domains hosted on Namecheap. Furthermore I've created a vhosts folder on my server and edited the httpd.conf file with the respective VirtualHost details and changes needed.
The default Apache page is loading when I visit my respective website domains but the actual website pages themselves are not loading.
How can I fix this?
I'm getting this error when restarting HTTPD
[warn] _default_ VirtualHost overlap on port 80, the first has precedence
The domain names in questions alphagleam.co.uk and conflictzonenorthwest.co.uk
You need to fix your httpd.conf file and make sure to include
NameVirtualHost *:80
once done make sure to restart apache and it should be ok

Apache localhost already used?! Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName"

I have a problem, I had apache Solr installed and it uses localhost for access on webserver...
now I have installed Apache and startet httpd.exe and I get the warning / error:
Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName"
when I stop solr, I can start and use localhost for apache httpd...
but I want to have the possibility to use both webservices, how can I configure Apache to do that? and get access to service not with localhost, but with another domain name or some configuration in httpd.conf
I tried to change the line "ServerName www.example.com:80" in httpd.conf file but no effect,
sorry but I'm pretty new to webservers and Apache, how should I configure that?
You have several things mixed here:
Installing Solr should in no way be related to other questions, unless it is configured to run on port 80. If that is the case, you simply can not run two services on the same port so you have to pick, or just move Solr to 8080 or whatever.
Could not reliably determine... is just a friendly warning and will not prevent any functionality, and it should disappear when you add ServerName www.example.com:80 in httpd.conf
With default settings, Apache will respond to any http request that comes to port 80, so you don't have to configure anything there (and if you want to modify that, use VirtualHost). You can achieve reaching your webserver by other hostnames by editing hosts file on your machine. If you want others to be able to do that, you have to configure DNS (which is separate issue)

Host multiple domains with apache

I'm trying to set up an ubuntu server to act as a dns server and host a simple webpage, some git repos, and some software for issue tracking, code review, and the like. I settled on Phabricator as the issue tracking/ code review software of choice, since it seemed to be a good all-in-one solution. I've got my server hosting my webpage and git repos, so that part seems to be working ok. Now here's the issue I've run into (from Phabricator configuration instructions):
If you haven't already, set up a domain name to point to the host you're installing on. You can either install Phabricator on a subdomain (like phabricator.example.com) or an entire domain, but you can not install it in some subdirectory of an existing website
I have no idea where to even begin setting up another domain name on my server. How do I set up a second domain name for Phabricator to use?
I see a lot of guides online that say to modify resolv.conf to add a dns entry, however mine looks like this:
Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.1
and I'm not sure what I should change to get dns entries to show up here.
I'm assuming you have only one IP address, which means you should be using virtual name-based hosting. There are a number of tutorials for doing this, but in short:
Create a virtual host configuration file in:
/etc/apache2/sites-available
For example:
nano /etc/apache2/sites-available/phabricator
Run:
a2ensite phabricator (in this example, but use the configuration file name you used above)
apache2ctl restart
The configuration file (which can be named whatever you'd like) needs to contain a number of items. A simple example would look like this:
<VirtualHost *:80>
DocumentRoot /www/example1
ServerName www.example.com
</VirtualHost>
DocumentRoot is the full path to the root of your site, usually where index.html, index.php, or the like is located. The default is /var/www. You could put somethig like /home/phabricator or /var/www/phabricator, but make sure you install Phabricator in the directory you specify.
ServerName is the full FQDN of your site, such as "www.google.com" or "phabricator.yourdomain.com" or even "phabricator.local". Basically it's the same value as you have set in your DNS for your A record, or in your /etc/hosts file. If you don't know about /etc/hosts, then disregard that part.
You'll probably need a few more directives in your configuration file, but you can find what's available on Google. I would suggest following some tutorials to get your configuraiton right.
But overall, you just need to create a virtual host config file, enable it, then restart the server, which is what the above instructions do. Apache will respond to the web request based on the site you put into your address bar.
P.S. Just noticed your DNS part of the question. Do you have DNS set up publicly to point a domain (example.com) or subdomain (something.example.com) to your server's IP address?

Apache - virtualhosts and global apache config

I have an apache server configured with multiple NameVirtualHosts running on the same IP. This all works fine.
However, because of the "include conf.d/*" directive, apache also picks up config for cacti and phpmyadmin, which add in aliases for /cacti and /phpmyadmin, and those aliases appear to be valid for all virtualhosts. That is to say, I can go to http://firstvirtualhost/cacti and also http://secondvirtualhost/cacti, and I get the same page.
In my case, the default namevirtualhost is publicly visible, and I do not want tools like phpmyadmin or cacti to be visible under that URL
In fact, I don't want any random package to be able to make itself visible across all virtualhosts simply by creating a file for itself in conf.d.
You have to delete the line include conf.d from the global Apache configuration file, and optionally add it to your own private virtual host configuration file.