Showing posts with label apache. Show all posts
Showing posts with label apache. Show all posts

Apache: _default_ virtualhost overlap on port 80

or Apache: _default_ virtualhost overlap on port 443

The size declaration place matters. Apache reads configuration settings from extras directory in alphabetic order. The error will appears if your virtual host was declared before httpd-vhost.conf 
The solution is quite simple. Just add to the httpd.conf before Listen 80 the line

NameVirtualHost *:80

If you use SSL virtual hosts add into httpd-ssl.conf file before Listen 443 the line

NameVirtualHost *:443


Enjoy!

apache: main default host is not accessible

I have added VirtualHost and can't access main DocumentRoot from httpd.conf :(
According to RTFM

Main host goes away

If you are adding virtual hosts to an existing web server, you must also create a <VirtualHost> block for the existing host. The ServerNameand DocumentRoot included in this virtual host should be the same as the global ServerName and DocumentRoot. List this virtual host first in the configuration file so that it will act as the default host.

Ok, i have added VirtualHost directly to httpd.conf and it doesn't help me at all. Why?
Because above of VirtualHost Directive was Include ..\conf.d\*
Hmmm...  Who says you can't teach a old fox new tricks?...

Just add new config file in conf.d directory and it must be first file.
Let's create conf.d/aaaa_default.conf file with content

#first VirtualHost is default

<VirtualHost *:80>

    ServerAdmin webmaster@firsthost.tdl
    DocumentRoot /var/www/html
    ServerName firsthost.tdl:80
    ServerAlias localhost

    ErrorLog  /var/log/httpd/error_log
    CustomLog /var/log/httpd/access_log common

</VirtualHost>


Whoops!!!! The file is loaded first because name(!) and corresponds to my default path.

Some useful settings in LogFormat are
 %f - local filename
%v - virtualhost name


LogFormat "%v %l %u %t \"%r\" %>s %b %f" common


Please note that i am using apache as httpd rpm from fedora core. Other distributive can be slightly different.

Enjoy!

apache: gif png jpg css gif etc is not executable; ensure interpreted scripts have

If appears error message in apache XXX  is not executable; ensure interpreted scripts have "#!"
you should checks that in script or cgi-bin directory only scripts are stored otherwise Apache will try to execute file.
Just move file to ..\images\ or ..\css\ directory and correct links.


and check also config section, you will find tip here.

apache: .js is not executable; ensure interpreted scripts have "#!"

If appears in apache log the following message

apache: .js is not executable; ensure interpreted scripts have "#!"

you should modify config file and use Alias instead of ScriptAlias


Alias /appl/ "C:/xampp/appl/"
<Directory>
AllowOverride All
Options Indexes MultiViews +ExecCGI
DirectoryIndex index.php
Order allow,deny
Allow from all
</Directory>

Asterisk AST_SORCERY function

 AST_SORCERY gets a field from a sorcery object. Sorcery is always created for PJSIP aors, endpoints and identifies in asterisk. It allows y...