When restarting the apache2 server, I'm getting a warning.
$ sudo service apache2 restart
* Restarting web server apache2
[Tue Sep 02 10:38:54 2014] [warn] NameVirtualHost *:80 has no VirtualHosts
[Tue Sep 02 10:38:54 2014] [warn] NameVirtualHost *:80 has no VirtualHosts
How do I resolve this warning?
The problem here is that there's a misconfiguration in your server. You want to make sure the values of Listen, NameVirtualHost and VirtualHost all match. In your case, I'd expect:
Listen *:80
NameVirtualHost *:80
<VirtualHost *:80>
ServerName ...
DocumentRoot ...
...
</VirtualHost>
Related
I want to redirect a certain path on my server to another port:
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass /hello http://localhost:8090/
ProxyPassReverse /hello http://localhost:8090/
</VirtualHost>
/etc/apache2/sites-enabled$ ll
lrwxrwxrwx 1 root root 35 Aug 22 2017 000-default.conf -> ../sites-available/000-default.conf
When I access server:80/hello, I'm presented with a 404.
I also have:
sudo a2enmod proxy
sudo a2enmod proxy_http
What might be missing here?
While I don't know why, I could resolve it replacing localhost with 127.0.0.1.
I use this configuration below in order to make my application available via SSL.
My question now would be how it is possible to set a timeout at **.
Is there a way of doing it and how would be the syntax?
# force HTTPS
<VirtualHost *:80>
ServerName app.xy.at
RewriteEngine on
RewriteCond %{SERVER_NAME} =app.xy.at
Redirect permanent "/" https://app.xy.at
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
# forward ORDS requests to tomcat
<VirtualHost *:443>
ServerName app.xy.at
# SSL certificates settings
#Include /etc/apache2/conf-enabled/options-ssl-apache.conf
SSLCertificateFile /etc/apache2/ssl/app.xy.at/fullchain.cer
SSLCertificateKeyFile /etc/apache2/ssl/app.xy.at/app.xy.at.key
SSLCertificateChainFile /etc/apache2/ssl/app.xy.at/ca.cer
ProxyRequests on
ProxyPreserveHost On
<Location / >
ProxyPass "ajp://localhost:9090/"
ProxyPassReverse "ajp://localhost:9090/"
</Location>
I will set a timeout because I get the following errors:
[Thu Mar 26 00:10:52.731383 2020] [proxy_ajp:error] [pid 16266:tid
139926293157632] [client
xxx.xxx.3.59:60869] AH00893: dialog to 127.0.0.1:9090 (localhost)
failed, referer:
https domain
[Thu Mar 26 00:10:57.802571 2020] [proxy_ajp:error] [pid 16266:tid
139926720988928]
(70014)End of file found: AH01030: ajp_ilink_receive() can't receive
header
[Thu Mar 26 00:10:57.802597 2020] [proxy_ajp:error] [pid 16266:tid
139926720988928] [client
xxx.xxx.3.59:60875] AH00992: ajp_read_header: ajp_ilink_receive
failed, referer:
https domain
[Thu Mar 26 00:10:57.802628 2020] [proxy_ajp:error] [pid 16266:tid
139926720988928]
(120006)APR does not understand this error code: [client
xxxx.xxxx.3.59:60875] AH00878: read
response failed from 127.0.0.1:9090 (localhost), referer: https domain
and I dont know why.
According to the documentation, You can pass different parameters along with the URL, in the format of key value pairs
ProxyPass "protocol://domain.com" key1=value1 key2=value2 ...
for your case,
ProxyPass "ajp://localhost:9090/" connectiontimeout=10 timeout=50
connectiontimeout : Connect timeout in seconds. The number of seconds
Apache httpd waits for the creation of a connection to the backend to
complete. By adding a postfix of ms, the timeout can be also set in
milliseconds.
timeout : Connection timeout in seconds. The number of seconds Apache
httpd waits for data sent by / to the backend.
I am trying to deploy Dancer2 app using Plack on Apache2. But after changing all the configurations on port 80 - it shows me directory listing instead of the application itself
Here is my running application on local:
root#dancer-cmuscheduler:/home/ADI/dancer_scheduler# plackup
bin/app.psgi HTTP::Server::PSGI: Accepting connections at
http://0:5000/
This runs just fine on port 5000.
However, I would like to deploy on apache2. Here is my configruations:
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /data
SetEnv DANCER_ENVIRONMENT "production"
<Directory /var/www/cmuscheduler>
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Location />
SetHandler perl-script
PerlResponseHandler Plack::Handler::Apache2
PerlSetVar psgi_app /var/www/cmuscheduler/bin/app.psgi
</Location>
ErrorLog ${APACHE_LOG_DIR}/error.log
</VirtualHost>
I have been trying to debug for 4 hours now. The funny thing is there is no helpful logs in the log file associated that would nudge me in the right direction
[Thu Jul 14 02:23:14.424149 2016] [mpm_event:notice] [pid 7468:tid
140401436669824] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming
normal operations [Thu Jul 14 02:23:14.424306 2016] [core:notice] [pid
7468:tid 140401436669824] AH00094: Command line: '/usr/sbin/apache2'
Please advice
Have configured vagrant Ubuntu 14.04 machine with virtual box.
I get the error (in browser)
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
And get the error (/var/log/apache2/error.log):
[Wed Apr 01 20:58:34.609309 2015] [fastcgi:error] [pid 24066:tid 3046103872] (104)Connection reset by peer: [client 192.168.33.1:59777] FastCGI: comm with server "/var/www/html/circulocolaborativo.com.br/php5.fcgi" aborted: read failed
[Wed Apr 01 20:58:34.614694 2015] [fastcgi:error] [pid 24066:tid 3046103872] [client 192.168.33.1:59777] FastCGI: incomplete headers (0 bytes) received from server "/var/www/html/circulocolaborativo.com.br/php5.fcgi"
My virtual host is configured with
<VirtualHost *:80>
Servername circulocolaborativo.local
DocumentRoot /var/www/html/circulocolaborativo.com.br
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# ErrorLog "/home/vagrant/logs/error_log"
<Directory /var/www/html/circulocolaborativo.com.br>
Options FollowSymLinks
DirectoryIndex index.php
Allowoverride all
Require all granted
</Directory>
Alias /php5.fcgi /var/www/html/circulocolaborativo.com.br/php5.fcgi
FastCGIExternalServer /var/www/html/circulocolaborativo.com.br/php5.fcgi -flush -host 127.0.0.1:5200 -idle-timeout 900
AddType application/x-httpd-fastphp5 .php
Action application/x-httpd-fastphp5 /php5.fcgi
<Location /var/www/html/circulocolaborativo.com.br/libraries/Sciere/ws/sptl >
AuthType Digest
AuthName "WebService SPTL"
AuthDigestDomain /libraries/Sciere/ws/sptl/
AuthDigestProvider file
AuthUserFile /var/www/html/.digest_pw_sptl
Require valid-user
</Location>
</VirtualHost>
Could someone help me to solve this issue? I can't figure out what is going on. I'm using php-fpm with fastcgi module.
I am trying to set up a virtual host at localhost. I am installing symfony 1.4 on my ubuntu 12.04 LTS, but I got some problems.
I installed apache2, php5 and mySql. Localhost works so I assume that apache it's ok.
You can found symfony installation and configuration instructions here.
After several days these are my configuration files:
http.conf:
ServerName 127.0.0.1
/etc/apache2/sites-available/test:
# Be sure to only have this line once in your configuration
NameVirtualHost 127.0.0.1:8080
# This is the configuration for your project
Listen 127.0.0.1:8080
<VirtualHost 127.0.0.1:8080>
DocumentRoot "/home/user/test/web"
DirectoryIndex index.php
<Directory "/home/user/test/web">
AllowOverride All
Allow from All
</Directory>
Alias /sf /home/user/test/lib/vendor/symfony/data/web/sf
<Directory "/home/user/test/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
and localhost:8080 doesn't works.
UPDATE:
Ok, after several modifications my httpd.conf is the same:
ServerName 127.0.0.1
And my /etc/apache2/sites-available/test:
Listen 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
DocumentRoot "/home/user/test/web"
DirectoryIndex index.php
<Directory "/home/user/test/web">
AllowOverride All
Allow from All
</Directory>
Alias /sf /home/user/test/lib/vendor/symfony/data/web/sf
<Directory "/home/user/test/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
If Apache use the port 80, remove this line in your conf:
NameVirtualHost 127.0.0.1:8080
Then replace all 8080 by 80 and try http://localhost. It should work.
edit:
Regarding the error could not bind to address 127.0.0.1:80 no listening sockets available, it seems you have an other server listening on the port 80.
Maybe it's a better idea to come back on the 8080 port (on the httpd.conf) and then update the ports.conf to set :
NameVirtualHost *:8080
Listen 8080
If you don't have a ports.conf file, find Listen in your main configuration file and do the update.
Verify you have your site test into /etc/apache2/sites-enabled/. if not do:
sudo a2ensite test
This command will enable the site test. Remember to restart apache.
Error message.
(98)Address already in use: make_sock: could not bind to address 127.0.0.1:80 no listening sockets available, shutting down Unable to open logs
It can be solved by commenting out the line Listen 80 in your httpd.conf file.
Regards
Rajkiran