Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

1 votes
3 answers
6463 views
Multiple virtual host in Centos 7 is not working together
My server information is Server version: Apache/2.4.6 (CentOS) Server built: Nov 19 2015 21:43:13 I am trying to configure virtual host for 2 different sites: biz.example.com and pin.example.com which are hosted on the same server. There are 2 different folders located under 'var/www/html/' named 'b...
My server information is Server version: Apache/2.4.6 (CentOS) Server built: Nov 19 2015 21:43:13 I am trying to configure virtual host for 2 different sites: biz.example.com and pin.example.com which are hosted on the same server. There are 2 different folders located under 'var/www/html/' named 'biz' and 'pin' with their respected project files for the above mentioned 2 websites. I am trying to configure it on the below way. Within /etc/hosts below configuration 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 xxx.xxx.xxx.xxx biz.example.com xxx.xxx.xxx.xxx pin.example.com xxx.xxx.xxx.xxx is replaced by the server IP address. Within /etc/httpd/conf/httpd.conf IncludeOptional sites-enabled/*.conf Now, under /etc/httpd/sites-available there are biz.conf and pin.conf file. I also have the folder sites-enabled under /etc/httpd which has 2 files that points to the biz.conf and pin.conf of sites-available folder using the below command ln -s /etc/httpd/sites-available/biz.conf /etc/httpd/sites-enabled/biz.conf ln -s /etc/httpd/sites-available/pin.conf /etc/httpd/sites-enabled/pin.conf biz.conf has the followings ServerName http://biz.example.com/ ServerAlias http://biz.example.com/ DocumentRoot "/var/www/html/biz" Options Indexes FollowSymLinks AllowOverride all Order Deny,Allow Allow from 127.0.0.1 And the configuration within pin.conf file is mentioned as ServerName http://pin.example.com/ ServerAlias http://pin.example.com/ DocumentRoot "/var/www/html/pin" Options Indexes FollowSymLinks AllowOverride all Order Deny,Allow Allow from 127.0.0.1 On this setup, if i try to access http://biz.example.com/ , the correct website (biz website) is loading. But if i try to access http://pin.example.com/ , then also biz website is loading instead of pin website. Multiple configuration is not working together. I also tried to merge the virtual configuration of biz.conf and pin.conf within a single file, biz.conf, but it didn't work as well.
Debashis (111 rep)
Dec 16, 2016, 11:38 AM • Last activity: Jul 8, 2025, 02:07 PM
2 votes
4 answers
22570 views
Apache2 not reading sites-enabled/*.conf
So I'm trying to set up my site with Apache on Ubuntu 14.04. I have created a `mydomain.com.conf` file in `sites-available/`. It looks like this; **mydomain.com.conf** ServerName mydomain.com ServerAlias www.mydomain.com ServerAdmin admin@mydomain.com DocumentRoot /var/www/mydomain.com/public_html E...
So I'm trying to set up my site with Apache on Ubuntu 14.04. I have created a mydomain.com.conf file in sites-available/. It looks like this; **mydomain.com.conf** ServerName mydomain.com ServerAlias www.mydomain.com ServerAdmin admin@mydomain.com DocumentRoot /var/www/mydomain.com/public_html ErrorLog ${APACHE_LOG_DIR}/mydomain.com/error.log CustomLog ${APACHE_LOG_DIR}/mydomain.com/access.log combined **000-default.conf** ServerAdmin webmaster@localhost #DocumentRoot /var/www ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined For some reason apache doesn't seem to read mydomain.com.conf at all, it will always default to the configuration in 000-default.conf. When visting my site I get a 403 Forbidden response. 1. I've enabled the site by a2ensite mydomain.com and reloaded Apache. 2. apachectl configtest returns Syntax OK The error.log file for **000-default.conf** says [Wed Sep 03 11:01:48.717652 2014] [autoindex:error] [pid 5869] [client 2.71.93.10:55718] AH01276: Cannot serve directory /var/www/: No matching DirectoryIndex (index.php,index.html,index.cgi,index.pl,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive while the error log & access log for mydomain.com is empty. My apache2.conf does a IncludeOptional sites-enabled/*.conf. The security model in apache2.conf looks like this; Options FollowSymLinks AllowOverride None Require all denied DirectoryIndex index.php, index.html AllowOverride None Require all granted What's wrong?
William Boman (131 rep)
Sep 3, 2014, 03:24 PM • Last activity: Mar 18, 2025, 09:37 AM
2 votes
1 answers
132 views
Can I install a Let'sEncrypt ssl certificate before I configure a virtual host?
Assuming I am not close on which web server to use, Apache or Nginx but I still want to be over with the SSL certification procedure, can I install a Let'sEncrypt ssl certificate before I configure a virtual host?
Assuming I am not close on which web server to use, Apache or Nginx but I still want to be over with the SSL certification procedure, can I install a Let'sEncrypt ssl certificate before I configure a virtual host?
automation (57 rep)
Oct 6, 2022, 07:55 AM • Last activity: Oct 6, 2022, 08:47 AM
0 votes
1 answers
1607 views
Configure a subdomain (Virtualhost) for phpMyAdmin
I have a problem with configuring a subdomain (Virtualhost) for phpMyAdmin. My current .conf look like this: ServerName php.erichermansson.com ServerAdmin webmaster@erichermansson.com DocumentRoot /usr/share/phpmyadmin Options FollowSymLinks DirectoryIndex index.php AddType application/x-httpd-php ....
I have a problem with configuring a subdomain (Virtualhost) for phpMyAdmin. My current .conf look like this: ServerName php.erichermansson.com ServerAdmin webmaster@erichermansson.com DocumentRoot /usr/share/phpmyadmin Options FollowSymLinks DirectoryIndex index.php AddType application/x-httpd-php .php php_flag magic_quotes_gpc Off php_flag track_vars On php_flag register_globals Off php_admin_flag allow_url_fopen Off php_value include_path . php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/ # Authorize for setup AuthType Basic AuthName "phpMyAdmin Setup" AuthUserFile /etc/phpmyadmin/htpasswd.setup Require valid-user # Disallow web access to directories that don't need it Order Deny,Allow Deny from All Order Deny,Allow Deny from All Do you guys have a clue what the problem could be? It only access the Apache testpage.
Eric Hermansson (73 rep)
Nov 10, 2015, 07:18 PM • Last activity: Jun 9, 2019, 06:02 AM
0 votes
1 answers
985 views
Redirect all non-root routes to index.html on Amazon Linux 2 and Apache
An Amazon Linux 2 instance is using Apache to host an Angular 7 app. The Angular 7 app includes not just `index.html`, but also several `.js` files and a subdirectory named `assets`. >**What specific syntax do I need to use in order to ensure that requests to Apache for all non-specified routes get...
An Amazon Linux 2 instance is using Apache to host an Angular 7 app. The Angular 7 app includes not just index.html, but also several .js files and a subdirectory named assets. >**What specific syntax do I need to use in order to ensure that requests to Apache for all non-specified routes get redirected to the index.html located in the DocumentRoot?** Note that the required syntax needs to also allow all the .js files and the contents of the assets directory to be served as secondary requests when the client browsers are loading index.html. For example, if a remote web browser requests mydomain.com/randomCharacters, I want Apache to return index.html the same way that Apache would respond to a request to mydomain.com with index.html. And then index.html must be able to get access to the .js files and the contents of the assets subdirectory. (In this case, DocumentRoot is a directory entitled /var/www/mydomain.com/public_html. Also, the /var/www/mydomain.com/public_html directory includes 1. index.html, 2. several .js files, and 3. an assets subdirectory containing things like images, etc.) I would like to use RedirectMatch inside of a VirtualHost block to keep the configuration as clean as possible. Here is what I have in mind. How does the following need to be modified? ServerName www.mydomain.com ServerAlias mydomain.com DocumentRoot /var/www/mydomain.com/public_html ErrorLog /var/www/mydomain.com/error.log CustomLog /var/www/mydomain.com/requests.log combined RedirectMatch 302 ^/(?!index.html$).+ http://mydomain.com **Forensic Analysis of Results:** When try the above with the Network Tab in the Developer Tools of Firefox open and I make a request to http://mydomain.com while the RedirectMatch 302 ^/(?!index.html$).+ http://mydomain.com is in the VirtualHost, the result is that all requests to / are shown to have given a 304 response, while all requests to named files like scripts and stylesheets are shown to have given 302 responses. Also, when I view the html page source for the same request, I see that the contents of index.html were indeed served correctly, but that the browser remained empty because the code in index.html was not able to access the .js files or the contents of the assets subdirectory. >So the problem is that RedirectMatch 302 ^/(?!index.html$).+ http://mydomain.com needs to be re-written to allow for the .js files and for the contents of the assets subdirectory. **What specific syntax is required to resolve this so that Apache can successfully server up the Angular 7 app no matter what character string is added after http://mydomain.com?**
CodeMed (5357 rep)
May 6, 2019, 08:37 PM • Last activity: May 6, 2019, 09:31 PM
2 votes
0 answers
247 views
H2O Webserver - Multiple domains - Is possible ? Or current version is only for one domain?
I'm testing h2o server : (some urls ) https://github.com/h2o/h2o/wiki https://calomel.org/h2o.html All works fine with only one domain but when I try to load multiple domains I can't load different paths for these domains: This is a simple settings ( I hide some config lines to question be clear ) :...
I'm testing h2o server : (some urls ) https://github.com/h2o/h2o/wiki https://calomel.org/h2o.html All works fine with only one domain but when I try to load multiple domains I can't load different paths for these domains: This is a simple settings ( I hide some config lines to question be clear ) : hosts: "domain_01.com": listen: PORT paths: "/": file.dir: /path_01 "domain_02.com": listen: PORT paths: "/": file.dir: /path_02 The problem is when I try to load domain_01.com/file.htm is always loaded the first path (path_01). What I'm doing wrong ? Is posible multiple domains with h2o server ?
Ricardo Cabello Torres - Brqx (51 rep)
May 2, 2017, 09:40 PM • Last activity: Mar 10, 2019, 04:30 AM
1 votes
1 answers
4489 views
Apache's 000-default.conf - weird behaviour
I'm trying to achieve a redirect from `example.com` to `www.example.com` (non-www to www). My **`sites-available/example.com.conf`** file looks like this; ServerName www.example.com ServerAdmin unidan@example.com DocumentRoot /var/www/example.com/public_html ErrorLog /var/www/example.com/logs/error....
I'm trying to achieve a redirect from example.com to www.example.com (non-www to www). My **sites-available/example.com.conf** file looks like this; ServerName www.example.com ServerAdmin unidan@example.com DocumentRoot /var/www/example.com/public_html ErrorLog /var/www/example.com/logs/error.log CustomLog /var/www/example.com/logs/access.log combined ServerName example.com Redirect permanent / http://www.example.com ServerName example.com Redirect permanent / https://www.example.com My **sites-available/000-default.conf** file looks like this; ServerAdmin zuckerberg@facebook.com DocumentRoot /var/www/default/public_html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined Now.. when requesting http://www.example.com it will respond as requested. However, when requesting http://example.com it will render the request using the configuration in 000-default.conf. Unlinking 000-default.conf from sites-enabled/ will fix this issue, however this is not something I want to do (I want to keep a default behaviour for unknown requests). What is the issue here? Why does the configuration in 000-default.conf override the redirect?
William Boman (131 rep)
Sep 3, 2014, 09:49 PM • Last activity: Jul 8, 2018, 08:01 PM
0 votes
2 answers
16280 views
Could not reliably determine the server's fully qualified domain name
I was following [this][1] tutorial to setup two virtual hosts in Centos 7. The issue is i am getting the following error while restarting the httpd. [userme@server ~]$ sudo systemctl restart httpd.service [sudo] password for userme: Job for httpd.service failed because the control process exited wit...
I was following this tutorial to setup two virtual hosts in Centos 7. The issue is i am getting the following error while restarting the httpd. [userme@server ~]$ sudo systemctl restart httpd.service [sudo] password for userme: Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details. My configurations are [userme@server ~]$ cat /etc/hosts 127.0.0.1 server.workstation.com server 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 [userme@server ~]$ hostname server.workstation.com [userme@server ~]$ cat /etc/sysconfig/network # Created by anaconda NETWORKING=yes HOSTNAME=server [userme@server ~]$ cat /etc/resolv.conf # Generated by NetworkManager search workstation.com nameserver fe80::1%p3p1 nameserver 192.168.100.1 [userme@server ~]$ domainname (none) **EDIT As per request** [userme@server ~]$ systemctl status httpd -l ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2018-01-18 12:55:25 +04; 57min ago Docs: man:httpd(8) man:apachectl(8) Process: 1285 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE) Process: 1283 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE) Main PID: 1283 (code=exited, status=1/FAILURE) Jan 18 12:55:25 server.workstation.com systemd[1] : Starting The Apache HTTP Server... Jan 18 12:55:25 server.workstation.com httpd: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using server.workstation.com. Set the 'ServerName' directive globally to suppress this message Jan 18 12:55:25 server.workstation.com systemd[1] : httpd.service: main process exited, code=exited, status=1/FAILURE Jan 18 12:55:25 server.workstation.com kill: kill: cannot find process "" Jan 18 12:55:25 server.workstation.com systemd[1] : httpd.service: control process exited, code=exited status=1 Jan 18 12:55:25 server.workstation.com systemd[1] : Failed to start The Apache HTTP Server. Jan 18 12:55:25 server.workstation.com systemd[1] : Unit httpd.service entered failed state. Jan 18 12:55:25 server.workstation.com systemd[1] : httpd.service failed. [userme@server ~]$ sudo firewall-cmd --list-all public (active) target: default icmp-block-inversion: no interfaces: p3p1 sources: services: ssh dhcpv6-client ports: protocols: masquerade: no forward-ports: source-ports: icmp-blocks: rich rules: [userme@server ~]$ apachectl configtest Syntax OK What is the issue with my network/hostname settings ? Any help would be appreciated.
ran (111 rep)
Jan 18, 2018, 09:47 AM • Last activity: Jan 18, 2018, 12:00 PM
2 votes
1 answers
1808 views
How to Stop a specific virtualhost in apache2
let's say I want to stop only the *example2* VirtualHost. How do I do it? `sudo service apache2 stop` will stop all the VirtualHosts. I want *example1* to keep running ServerName www.example1.com ServerAdmin webmaster@localhost DocumentRoot /var/www/example1 ErrorLog ${APACHE_LOG_DIR}/error.log Cust...
let's say I want to stop only the *example2* VirtualHost. How do I do it? sudo service apache2 stop will stop all the VirtualHosts. I want *example1* to keep running ServerName www.example1.com ServerAdmin webmaster@localhost DocumentRoot /var/www/example1 ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined ServerName www.example2.com ServerAdmin webmaster@localhost DocumentRoot /var/www/example2 ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined
Aman Deep (21 rep)
Dec 9, 2017, 05:32 PM • Last activity: Dec 9, 2017, 05:35 PM
0 votes
2 answers
619 views
Unable to load the AWS ELB on 443 port but able to access ELB url on 80 port
I have 2 webservers under AWS ELB. Each webserver has one virtual host file and bundle.crt, .key files. When I tried to load the ELB with http then its directing to the webservers fine but when I use https://ELB url then I am getting below error. [![enter image description here][1]][1] [1]: https://...
I have 2 webservers under AWS ELB. Each webserver has one virtual host file and bundle.crt, .key files. When I tried to load the ELB with http then its directing to the webservers fine but when I use https://ELB url then I am getting below error. enter image description here I am tried various options to troubleshoot this issue. I changed the certificates in webserver, I changed the listener ports on the ELB servers, I checked the security group of instances and ELB, I verified the httpd.conf file, verified ssl_conf file but I didnt find any server level error or misconfigurations. All seems to be good at server level but still I am facing above issue. When I tested my web url in ssltest site then I got "The secure protocol is not support" error. I am not sure how to proceed further.
vil (21 rep)
Sep 20, 2017, 07:20 PM • Last activity: Sep 20, 2017, 08:00 PM
0 votes
1 answers
952 views
Apache reverse proxy redirects every address to the same vhost
I have installed a webapp in a virtual machine on my server (both running Debian 8 and Apache2). I used a reverse proxy on the host machine to redirect all the connections made to https://webapp.domain.com to the internal address of the webapp on the virtual machine (http://192.168.100.101/webapp) u...
I have installed a webapp in a virtual machine on my server (both running Debian 8 and Apache2). I used a reverse proxy on the host machine to redirect all the connections made to https://webapp.domain.com to the internal address of the webapp on the virtual machine (http://192.168.100.101/webapp) using the following vhost configuration: ServerName webapp.domain.com ServerAlias www.webapp.domain.com SSLProxyEngine On SSLProxyCheckPeerExpire off SSLProxyCheckPeerCN off SSLProxyVerify none ProxyPass / http://192.168.100.101/webapp/ ProxyPassReverse / http://192.168.100.101/webapp/ SSLEngine on SSLCertificateFile /etc/letsencrypt/live/webapp.domain.com/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/webapp.domain.com/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/webapp.domain.com/fullchain.pem ServerAdmin unavailable CustomLog ${APACHE_LOG_DIR}/vhosts/webapp_access.log combined ErrorLog ${APACHE_LOG_DIR}/vhosts/webapp_error.log Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" Order Allow,Deny Allow from all However if I try to connect to any address on the ip of the host machine, I end up seeing the webapp on the virtual machine (i.e., let's assume that the public IP of the host machine is 10.10.10.10, connecting to https://10.10.10.10/anything shows me the webapp on the virtual machine). How can I prevent this from happening? Could it be the guest machine configuration the cause of this?
giovi321 (919 rep)
Aug 29, 2017, 03:34 PM • Last activity: Aug 29, 2017, 03:47 PM
0 votes
1 answers
115 views
Apache redirection based on referrer in CentOS 7
**How can I configure Apache httpd on a CentOS 7 server so that requests for any path under `home.mydomain.com` are only served if the referrer for the request was from a path under `mydomain.com`?** And so that requests from referrers other than `mydomain.com` are redirected to `mydomain.com/login`...
**How can I configure Apache httpd on a CentOS 7 server so that requests for any path under home.mydomain.com are only served if the referrer for the request was from a path under mydomain.com?** And so that requests from referrers other than mydomain.com are redirected to mydomain.com/login? Here are the VirtualHost definitions for mydomain.com and for host.mydomain.com: ServerName www.mydomain.com ServerAlias mydomain.com ErrorLog /var/log/httpd/mydomain_com_error.log CustomLog /var/log/httpd/mydomain_com_requests.log combined DocumentRoot /var/www/mydomain.com/public_html ServerName home.mydomain.com ProxyPass / http://localhost:4000/ connectiontimeout=5 timeout=30
CodeMed (5357 rep)
Jun 30, 2017, 11:16 PM • Last activity: Jul 1, 2017, 02:25 AM
3 votes
1 answers
906 views
Port 81 for http is redirecting to 80
I have created port 80 and 81 for my Apache. Below is the configuration. Listen 80 Listen 81 DocumentRoot "/var/www/html/wp" ServerName www.test.tk DocumentRoot "/var/www/html/pw" ServerName www.exampl.com The issue is, if I call `www.exampl.com` with port 80, it will redirect to `www.test.tk`. I wa...
I have created port 80 and 81 for my Apache. Below is the configuration. Listen 80 Listen 81 DocumentRoot "/var/www/html/wp" ServerName www.test.tk DocumentRoot "/var/www/html/pw" ServerName www.exampl.com The issue is, if I call www.exampl.com with port 80, it will redirect to www.test.tk. I want it to show the default page of Apache for www.exampl.com:80 and IP:80 as well. How do I do it?
superman (79 rep)
Jun 9, 2017, 08:16 PM • Last activity: Jun 10, 2017, 06:23 AM
0 votes
2 answers
1123 views
Making domain-name only accessible web server with apache2
I have a domain name `example.com` and a VPS with a static IP address `123.123.123.123`. I want the browsers to provide the domain name to access the website content. In pratice I want people see my website only if they put `exemple.com` and not `123.123.123.123` on their browser's url bar. So in my...
I have a domain name example.com and a VPS with a static IP address 123.123.123.123.
I want the browsers to provide the domain name to access the website content.
In pratice I want people see my website only if they put exemple.com and not 123.123.123.123 on their browser's url bar. So in my /var/www/ directory I made two subdirectories.
/var/www/default (for the content that those who do not provide the dn will see) and
/var/www/exemple for the actual website content.
I edited my /etc/apache2/sites-enabled/000-default.conf file like this. DocumentRoot /var/www/default ServerName example.com ServerAlias example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/exemple ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined In my mind this should work. In pratice the server gives me the content of /var/www/default both if i put 123.123.123.123 and exemple.com in my browser's url bar. Why?
Carlo (103 rep)
Mar 22, 2017, 03:41 PM • Last activity: Mar 22, 2017, 04:44 PM
3 votes
0 answers
2391 views
Use apache virtual host to redirect a subdomain to internal ip preserving passed port
I've been looking for a while to the answer to this question and I seem to find slightly different needs from people asking questions and they get wildly different answers... but none of them seem to fit my problem. I have a server that uses (successfully) mod_proxy to redirect subdomains of my main...
I've been looking for a while to the answer to this question and I seem to find slightly different needs from people asking questions and they get wildly different answers... but none of them seem to fit my problem. I have a server that uses (successfully) mod_proxy to redirect subdomains of my main domain to other machines on my network, however I always need to specify the port like so ServerName sub.domain.com ProxyPreserveHost On ProxyPass / http://192.168.1.123/ ProxyPassReverse / http://192.168.1.123/ What I want to accomplish is to redirect any type of connection to that subdomain AND the specified port to a different machine so something like ServerName sub.domain.com ProxyPreserveHost On ProxyPass / http://192.168.1.123/ ProxyPassReverse / http://192.168.1.123/ so it would translate to sub.domain.com:1234 => 192.168.1.123:1234 sub.domain.com:5678 => 192.168.1.123:5678 etc... the documentation **official documentation ** seems to suggest it is possible by passing *:* but when I do I land on my default page on my server...
TonyMorello (351 rep)
Mar 5, 2017, 01:45 AM
1 votes
2 answers
83 views
Is there some security restriction preventing apache2 from listening on a high port?
I have configured an Apache2 virtual host to listen on a port above port 80, 8011 in this case. `apachectl configtest` returns no error in regards on the usage of the high port, yet netstat indicates the port is not in use and telneting to the IP address shows it is not in use. The Apache log genera...
I have configured an Apache2 virtual host to listen on a port above port 80, 8011 in this case. apachectl configtest returns no error in regards on the usage of the high port, yet netstat indicates the port is not in use and telneting to the IP address shows it is not in use. The Apache log generates no logs. Here is the virtual host configuration. As far as I can tell using port 8011 should work as there is nothing listening on it, yet Apache2 seems to ignore it completely. Could there be some apparmor or SELinux configuration stopping it? Is the virtual host failing to load? If it is failing then apache2 is not logging an error. ServerName lazrepos.ho.local ServerAlias util01.lazrepos.ho.local lazrepos.br.local util01.lazrepos.br.local util01.lazrepos.local lazvbox.local ServerAdmin webmaster@localhost DocumentRoot /home/lazrepos/repos/svn DirectoryIndex index.html Require all granted AddHandler cgi-script .cgi .pl Options +ExecCGI Order allow,deny Allow from all ScriptAlias /viewvc /home/lazrepos/repos/cgi/viewvc/bin/cgi/viewvc.cgi ScriptAlias /query /home/lazrepos/repos/cgi/viewvc/bin/cgi/query.cgi ErrorLog /home/lazrepos/sites/lazrepos/www/logs/apache2/error.log CustomLog /home/lazrepos/sites/lazrepos/www/logs/apache2/access.log combined # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf LoadModule dav_module modules/mod_dav.so LoadModule dav_svn_module modules/mod_dav_svn.so DAV svn SVNParentPath /home/lazrepos/repos/svn/fpc_laz # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
vfclists (7909 rep)
Feb 20, 2017, 08:10 PM • Last activity: Feb 26, 2017, 03:01 PM
0 votes
1 answers
1199 views
setting up permissions for Virtual Host on Centos 7
I am following a book's chapter on setting up Virtual Hosts. The process is: 1.create a file `/etc/httpd/conf.d/example.com.conf` 2.set its content to ServerName www.example.com ServerAlias example.com DocumentRoot /var/www/html/example/ And finally 3.execute `apachectl configtest` and `apachectl gr...
I am following a book's chapter on setting up Virtual Hosts. The process is: 1.create a file /etc/httpd/conf.d/example.com.conf 2.set its content to ServerName www.example.com ServerAlias example.com DocumentRoot /var/www/html/example/ And finally 3.execute apachectl configtest and apachectl graceful This appears to be working. But more commonly, DocumentRoot is located in /home/exampleuser/public_html. This path is problematic to apache group so I modified permissions to drwxr-x--- 3 exampleuser apache 4096 Feb 8 09:50 exampleuser drwxr-xr-x 2 exampleuser apache 4096 Feb 8 09:55 public_html where exampleuser is the user that to which the the directory belongs and was created with useradd exampleuser command. I also added this code in /etc/httpd/conf/httpd.conf and reloaded httpd.service. Options Indexes FollowSymLinks AllowOverride None Require all granted The book doesn't state what is the correct permission configuration so I am wondering if I have done it correctly? Is there a security issue if I leave the permissions as they are now? httpd error_log file [Wed Feb 08 10:25:55.453239 2017] [mpm_prefork:notice] [pid 4848] AH00171: Graceful restart requested, doing restart AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using example.com. Set the 'ServerName' directive globally to suppress this message [Wed Feb 08 10:25:55.732490 2017] [auth_digest:notice] [pid 4848] AH01757: generating secret for digest authentication ... [Wed Feb 08 10:25:55.733391 2017] [lbmethod_heartbeat:notice] [pid 4848] AH02282: No slotmem from mod_heartmonitor [Wed Feb 08 10:25:55.736501 2017] [:warn] [pid 4848] NSSSessionCacheTimeout is deprecated. Ignoring. [Wed Feb 08 10:25:55.745349 2017] [mpm_prefork:notice] [pid 4848] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_auth_kerb/5.4 mod_fcgid/2.3.9 mod_nss/1.0.14 NSS/3.21 Basic ECC configured -- resuming normal operations [Wed Feb 08 10:25:55.745375 2017] [core:notice] [pid 4848] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
sanjihan (415 rep)
Feb 8, 2017, 10:02 AM • Last activity: Feb 8, 2017, 11:07 AM
3 votes
1 answers
4019 views
How to setup virtual hosts to point to two diffrent directories
I have one domain and a sub domain which are supposed to point to two different folder, i have tried this help but still i have issues. (https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04) www.wasamar.com.ng | wasamar.com.ng -> /var/www/html/wasamar/p...
I have one domain and a sub domain which are supposed to point to two different folder, i have tried this help but still i have issues. (https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04) www.wasamar.com.ng | wasamar.com.ng -> /var/www/html/wasamar/public this is the virtual host file (/etc/apache2/sites-available/wasamar.com.ng.conf) ServerName wasamar.com.ng ServerAlias www.wasamar.com.ng ServerAdmin info@wasamar.com.ng DocumentRoot /var/www/html/wasamar/public # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf www.ts.wasamar.com.ng | ts.wasamar.com.ng -> /var/www/html/wasamar_ts/public this is the virtual host file (/etc/apache2/sites-available/ts.wasamar.com.ng.conf) ServerName ts.wasamar.com.ng ServerAlias www.ts.wasamar.com.ng ServerAdmin info@wasamar.com.ng DocumentRoot /var/www/html/wasamar_ts/public/ # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf The pastebin of apache.conf file http://pastebin.com/dnDfB21y How do i achieve this?
udemethegrtman (33 rep)
Jan 21, 2017, 03:17 AM • Last activity: Jan 21, 2017, 07:23 AM
0 votes
1 answers
395 views
Adding a Django site breaks my virtual hosts on CentOS 7
I have a **CentOS 7 server** with about 20 domains all managed automatically with a **vhosts file in /etc/httpd/conf.d**. I am trying to learn **Django** and wanted to set up a single domain using it, so I added a specific virtualhost to the .conf file. The result is that the Django domain works fin...
I have a **CentOS 7 server** with about 20 domains all managed automatically with a **vhosts file in /etc/httpd/conf.d**. I am trying to learn **Django** and wanted to set up a single domain using it, so I added a specific virtualhost to the .conf file. The result is that the Django domain works fine but **all the other sites are broken** (try to use Django but cause errors). The Django domain has **two folders:** **djangodomain.com** for static files and **djangodomain.app** for the Python files. **How can I integrate a single Django domain into my existing many-domain virtual host setup?** Existing vhosts.conf: serveradmin username@domain.com serveradmin username@domain.com usecanonicalname off # www.site.com » site.com rewriteengine on rewritecond %{HTTP_HOST} ^www\.(.*)$ [nc] rewriterule ^(.*)$ http://%1 [r=301,l] # file locations virtualdocumentroot "/home/username/%0" allowoverride all require all granted options indexes followsymlinks options +execcgi options +includes What I added that broke all but the Django site: ServerName djangodomain.com ServerAlias www.djangodomain.com ServerAdmin user@domain.com DocumentRoot /home/username/djangodomain.com WSGIScriptAlias / /home/username/djangodomain.app/django.wsgi Order allow,deny Allow from all Alias /robots.txt /home/username/djangodomain.com/robots.txt Alias /favicon.ico /home/username/djangodomain.com/favicon.ico Alias /images /home/username/djangodomain.com/images Alias /static /home/username/djangodomain.com/static ErrorLog /home/username/djangodomain.logs/error.log CustomLog /home/username/djangodomain.logs/access.log combined [update: problem solved] Crossposted to Stack Exchange
Andrew Swift (103 rep)
Oct 21, 2016, 07:00 PM • Last activity: Oct 24, 2016, 02:02 PM
0 votes
2 answers
2771 views
Apache Virtual Host not working on Ubuntu 14.04 LTS
I've been using [this tutorial][1] to set up an Apache virtual host on my Ubuntu PC. I've created a `no-ip domain` which I will be using as the hostname of my virtual host. I've followed every step of the tutorial but it doesn't work. Here's the virtual host file and it's named `crm2plus.ddns.net.co...
I've been using this tutorial to set up an Apache virtual host on my Ubuntu PC. I've created a no-ip domain which I will be using as the hostname of my virtual host. I've followed every step of the tutorial but it doesn't work. Here's the virtual host file and it's named crm2plus.ddns.net.conf: # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. #ServerName www.example.com ServerAdmin webmaster@crm2plus.ddns.net ServerName crm2plus.ddns.net ServerAlias crm2plus.ddns.net DocumentRoot /var/www/crm2plus.ddns.net/public_html # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf Options FollowSymLinks AllowOverride All Options Indexes FollowSymLinks MultiViews AllowOverride All Order Allow,Deny Allow from all # vim: syntax=apache ts=4 sw=4 sts=4 sr noet I've also added the ip and domain name pair to my local hosts file and here's how it looks: 23.253.21.201 shhasan.ddns.net 127.0.1.1 Ubuntu-Dev 127.0.0.1 localhost 99.250.71.177 crm2plus.ddns.net # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters When I navigate to crm2plus.ddns.net through chrome I get the web page not available page. shhasan.ddns.net is working fine. When I type ssh-keygen -H -F crm2plus.ddns.net into the terminal nothing shows up but when I type ssh-keygen -H -F shhasan.ddns.net this is what shows up: # Host shhasan.ddns.net found: line 14 type RSA followed by the RSA key. I've also looked at the Apache error and access logs. The error logs have a lot of repetition of such line of code: [Fri Nov 14 17:44:50.304782 2014] [mpm_prefork:notice] [pid 21927] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 configured -- resuming normal operations [Fri Nov 14 17:44:50.304801 2014] [core:notice] [pid 21927] AH00094: Command line: '/usr/sbin/apache2' [Fri Nov 14 17:44:54.979832 2014] [mpm_prefork:notice] [pid 21927] AH00169: caught SIGTERM, shutting down I searched for caught SIGTERM, shutting down and I found that this was part of normal operation. I have no idea of where I'm going wrong. It had worked previously for shhasan.ddns.net but it doesn't work for crm2plus.ddns.net. Output of netstat -pan | grep 80: unix 2 [ ] STREAM CONNECTED 528079 5594/gvfsd-http @/dbus-vfs-daemon/socket-vc8j6I1O unix 3 [ ] STREAM CONNECTED 18079 2579/dbus-daemon @/tmp/dbus-nICf5nhpay unix 3 [ ] STREAM CONNECTED 18067 2579/dbus-daemon @/tmp/dbus-nICf5nhpay unix 2 [ ] DGRAM 8009 - unix 3 [ ] STREAM CONNECTED 18116 2680/indicator-appl unix 3 [ ] STREAM CONNECTED 18076 2488/dbus-daemon @/tmp/dbus-PTGbrLg1OB unix 3 [ ] STREAM CONNECTED 18085 2587/ibus-ui-gtk3 unix 2 [ ] STREAM CONNECTED 528093 5594/gvfsd-http @/dbus-vfs-daemon/socket-XXVPW75v unix 3 [ ] STREAM CONNECTED 20680 2827/compiz unix 3 [ ] STREAM CONNECTED 18072 2488/dbus-daemon @/tmp/dbus-PTGbrLg1OB unix 3 [ ] STREAM CONNECTED 225804 4011/chrome unix 3 [ ] STREAM CONNECTED 18008 2488/dbus-daemon @/tmp/dbus-PTGbrLg1OB unix 3 [ ] STREAM CONNECTED 228060 2541/ibus-daemon @/tmp/dbus-8s7gwnYp unix 3 [ ] STREAM CONNECTED 18071 2488/dbus-daemon @/tmp/dbus-PTGbrLg1OB unix 3 [ ] STREAM CONNECTED 225280 4011/chrome unix 3 [ ] STREAM CONNECTED 18069 2607/at-spi2-regist unix 3 [ ] STREAM CONNECTED 18001 2501/window-stack-b unix 2 [ ] STREAM CONNECTED 9700589 5594/gvfsd-http @/dbus-vfs-daemon/socket-80dWj6IE unix 3 [ ] STREAM CONNECTED 18044 2488/dbus-daemon @/tmp/dbus-PTGbrLg1OB
shhasan (101 rep)
Nov 15, 2014, 03:43 AM • Last activity: Aug 14, 2016, 12:55 AM
Showing page 1 of 20 total questions