Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
9 votes
Accepted

Possible to split virtual host definitions into multiple apache conf files?

You can use the Include directive to include other config files and split up your main config. # Virtual hosts Include conf/extra/httpd-vhosts.conf You can also use wildcards, so you can have each ...
MrWhite's user avatar
  • 42.8k
7 votes
Accepted

What is the best practice for redirecting the IP address of a web server when it hosts multiple domain names?

The answer is in the comment: Hosting companies that offer shared accounts typically have a number of sites hosted all on the same IP address using virtual hosts as you've done.. They point the IP ...
Mike's user avatar
  • 151
4 votes

SSLCipherSuite settings not taking effect from Apache ssl.conf, only when duplicated in each virtual host

Just hit a possibly similar or identical issue though with me it was to update a clients SSL to drop TLSv1 and TLSv1.1 support. The default way is edit ssl.conf and set: SSLProtocol all -SSLv3 -TLSv1 -...
Ian Macintosh's user avatar
4 votes

Do I need to change the host file of each computer to share a web page on a local network using a hostname?

This depends on how your network is setup. If you have a central DNS server on your network (as many enterprise business networks have) then you can add a zone record for whatever domain you wish for ...
Chris Rutherfurd's user avatar
3 votes

Have disabled apache site config file 000-default.conf, but it still seems active. Why?

I agree with user 'closetnoc' who replied at [2015-Aug-2 00:24:36Z] in response to the original post that wrote "The 000-default.conf site is a catch-all for any request the server does not have a ...
kman's user avatar
  • 31
3 votes

How to install WAMP with multiple hosts on a non-standard port, over a FIOS connection?

I used Windows 10 PC with WAMP version 3.2.6_x64 (Apache 2.4.51) The legacy server will continue to use port 80, and the new server will use port 8080 The following lists the several steps I used ...
danielh's user avatar
  • 91
2 votes

How to Add Two Domains ON 1 IP using webmin

Open your webmin Go to servers Go to Apache Webserver Create virtual host Check if it works from Existing virtual hosts and it well look like below:
Ahmed Reda's user avatar
2 votes
Accepted

What virtual host should I serve when someone hits my webserver without a "Host:" header?

Considering RFC-7230, you might just return 400 for such request: A server MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message that lacks a Host header field and to any ...
Braiam's user avatar
  • 210
2 votes
Accepted

Is this possible: Use css from other virtual host?

Yes, but as you already guessed you wouldn't be able to use relative paths because that would take you outside of the web root. You you would need to use the full URL to the CSS file to reference it ...
John Conde's user avatar
  • 86.3k
2 votes

Apache 2.4, trying to turn off DirectorySlash

Make sure your browser cache is cleared. DirectorySlash (mod_dir) adds the slash with a 301 redirect, so these will have been cached (hard) by the browser. Incidentally, you can check where the slash ...
MrWhite's user avatar
  • 42.8k
2 votes

SSLCipherSuite settings not taking effect from Apache ssl.conf, only when duplicated in each virtual host

Just had the very same issue with my Apache 2.4 configuration on CentOS version 8. We are all mistaken on the meaning of the _default_:443 host: this section does not contain the default settings for ...
Adrian's user avatar
  • 21
2 votes

SSLCipherSuite settings not taking effect from Apache ssl.conf, only when duplicated in each virtual host

I had the same issue under CentOS 7 and Apache 2.4.6, and the fix was to move the SSLCipherSuite directive outside of the <VirtualHost _default_:443> in my SSL configuration file that I include ...
VirtualWolf's user avatar
2 votes

Handling requests to server's IP address

If you have multiple virtual hosts / sites on the same server then you should either block any direct request for the server's IP address or serve some other "default" (noindex) web page, not ...
MrWhite's user avatar
  • 42.8k
2 votes

how to modify virtualhost in WHM?

Cpanel/WHM does NOT support Ruby on Rails out the box, you need to provision the Ruby via mod_passenger profile under your EasyApache 4 and deploy each application from Cpanel Application Manager ...
gabehou's user avatar
  • 552
2 votes

What is the best practice for redirecting the IP address of a web server when it hosts multiple domain names?

The answer to your question "What is the best practice for redirecting the IP address of a web server when it hosts multiple domain names?" is this: Best practice is to use a redirect (Apache) or ...
Tom Brossman's user avatar
  • 2,291
2 votes

How can the index.html file be served from a sub directory of the DocumentRoot without using system level links?

You may want the mod_rewrite solution that @Stephen suggests, however, also consider DirectoryIndex (depending on your requirements). The DirectoryIndex document tells Apache which file to serve when ...
MrWhite's user avatar
  • 42.8k
2 votes
Accepted

How to remove port number from the URL?

Change the port number from 90 to 80 to remove it from the URL. The default port number for HTTP is port 80. If you use any other port number, that port number has to be specified in the URL. ...
Stephen Ostermiller's user avatar
2 votes

Subdomains getting redirected to root directory of virtualhost

As mentioned in comments, I don't see any spurious redirects that you appear to be reporting and the two URLs do appear to return different content (although they "look similar"). So this appears to ...
MrWhite's user avatar
  • 42.8k
2 votes

How to log in via ssh to a newly created virtual machine at Hetzner

So let my own answer be here (support helped me) - hopefully somebody else will find solution quicker. So, if you've created server with ssh key provided you won't get any password by e-mail. The ...
shabunc's user avatar
  • 161
2 votes

How to log in via ssh to a newly created virtual machine at Hetzner

What helped me is connecting with user root: ssh root@YOURIP
Andy's user avatar
  • 21
1 vote

Creating new virtual server or Sub-server breaks all existing domains

RESOLVED For now I have resolved the issue by editing, /etc/apache2/sites-available/xxxx.conf The change I made in the first line, <VirtualHost 128.xxx.xxx.227:80> Changed it to, <...
afdhaal faurdeen's user avatar
1 vote

VirtualHosts Not Working - Apache - CentOS 6

First issue is that you've set both of your VirtualHost configs to use DocumentRoot /home/website/public_html -- one should be /home/webapp/public_html. Next issue sounds like DNS, you mention adding ...
Migrateq's user avatar
  • 121
1 vote
Accepted

Individual directory options for every VirtualHost in Apache2

I just found a solution on my own. I created two symlinks, both pointing to the desired folder. Then, I used one of them for the public VirtualHost and the other one for the private one. Works ...
Sandtler's user avatar
1 vote

Put WAMP online but hide its server index page

the server's index file which shows the list of all the projects is also accessible. What I want is to be only able to view it from local machine, not from others. Others can only access the index ...
MrWhite's user avatar
  • 42.8k
1 vote

Multiple PHP versions on one Digital Ocean droplet

You could consider PHPBrew: https://github.com/phpbrew/phpbrew There's an overview here of the process: http://www.sivaschenko.com/multiple-php-versions-simultaneously-apache/
Nick's user avatar
  • 20.5k
1 vote
Accepted

I have three virtualhosts on my WAMP Stack, one works, the other gets 404'd

I would not recommend setting different DocumentRoots that are subdirectories of each other. Rather each site should have its own independent directory. I'd change your first virtual host to: ...
Stephen Ostermiller's user avatar
1 vote

How can the index.html file be served from a sub directory of the DocumentRoot without using system level links?

Your rewrite rule is close. You just need to restrict it a bit more. RewriteRule ^\/?$ /html/index.html [L] The \/ matches a literal slash, which is the desired URL for the home page. It is ...
Stephen Ostermiller's user avatar
1 vote
Accepted

Should I use VPS IP addresses or VPS domain names in the DNS Settings?

Using A or CNAME records will have no effect on whether or not your site appears when you type in the IP address. Your site appears when you type in the IP address because every server MUST have an ...
Stephen Ostermiller's user avatar
1 vote

SSLCipherSuite settings not taking effect from Apache ssl.conf, only when duplicated in each virtual host

You are definitely taking the correct approach, so let's test a couple things. I will assume current stable Apache + Ubuntu 16.04 for your server since that's very common, but adjust the commands / ...
Tom Brossman's user avatar
  • 2,291
1 vote
Accepted

Serve a subdirectory out of a parallel server side directory

You need to use the Alias directive from mod_alias. It is designed to serve documents for a path from a different server side directory: <VirtualHost *:80> ServerName www.example.com ...
Stephen Ostermiller's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible