I am installing Koha from source. Generic unix directions indicate the following step after sudo make install
sudo ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha
huh?
My apache2 directory contains no sites-available, only
/private/etc/apache2/extra
/private/etc/apache2/httpd.conf
/private/etc/apache2/magic
/private/etc/apache2/mime.types
/private/etc/apache2/original
/private/etc/apache2/other
/private/etc/apache2/users
I am supposed to be able to Browse to http://servername:8080/ to run Koha, where I take it "servername" is specified in koha-httpd.conf as follows:
## Intranet
<VirtualHost 192.168.1.4:8080>
ServerAdmin webmaster#local
DocumentRoot /usr/share/koha/intranet/htdocs
ServerName John-Breedloves-Mac-mini.local:8080
# ServerAlias intranet.mydomain.com
ScriptAlias /cgi-bin/koha/ "/usr/share/koha/intranet/cgi-bin/"
ScriptAlias /index.html "/usr/share/koha/intranet/cgi-bin/mainpage.pl"
ScriptAlias /search "/usr/share/koha/intranet/cgi-bin/search.pl"
ErrorLog /var/log/koha/koha-error_log
# TransferLog /var/log/koha/koha-access_log
SetEnv KOHA_CONF "/etc/koha/koha-conf.xml"
SetEnv PERL5LIB "/usr/share/koha/lib"
Options +FollowSymLinks
ErrorDocument 400 /cgi-bin/koha/errors/400.pl
ErrorDocument 401 /cgi-bin/koha/errors/401.pl
ErrorDocument 403 /cgi-bin/koha/errors/403.pl
ErrorDocument 404 /cgi-bin/koha/errors/404.pl
ErrorDocument 500 /cgi-bin/koha/errors/500.pl
RewriteEngine On
However when I go to http://john-breedloves-mac-mini.local:8080/, I get:
It works!
Which,is, like ironical or something.
Help a noob out.
It looks like /private/etc/apache2/other/ would be the approximately corresponding folder. /etc/apache2/httpd.conf contains a directive Include /private/etc/apache2/other/*.conf that includes all files in that folder, much like the sites-available folder common on Linux installations of Apache.
Run apachectl -S which is shorthand for apachectl -t -D DUMP_VHOSTS
According to the apachectl man file, this will show parsed settings (currently only vhost settings). Incidentally, it also checks your config file for errors.
Andrew's answer is correct. On my install, I additionally had to change
Order allow,deny
Deny from all
to
Order allow,deny
Allow from all
in /etc/apache2/httpd.conf.
The fact that you're getting a server at :8080 indicates that you may be running a different apache config from the base system install, such as MAMP; I don't believe that apache by default listens on :8080.
I had this problem too. It seems to occour because the default version of apache that is installed on osx over-rides other versions. to disable it go to "System Preferences > Sharing" and untick "web sharing".
good luck!
Please note that ServerRoot specifies where the subdirectories conf and logs can be found.
In my httpd.conf, it is set to /usr
Related
Im trying to set up my local environment on my new mac OSX 10.9. I know it has apache already installed, so i've been using that. No matter how I set up my httpd-vhosts.conf/hosts/httpd.conf files, I continuously get a 403 forbidden error when visiting localhost OR "test.com" on my browser. The error / files / other information is listed below.
This is the error I'm getting when visiting either web page
Forbidden
You don't have permission to access / on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
My /private/etc/hosts file
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 test.com
127.0.0.1 www.test.com
My /private/etc/apache2/httpd.conf file
This file is in its original form besides the following changes:
Uncommented Include /private/etc/apache2/extra/httpd-vhosts.conf
My /private/etc/apache2/extra/httpd-vhosts file
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Library/WebServer/Documents/
</VirtualHost>
<VirtualHost *:80>
ServerName test.com
ServerAlias www.test.com
DocumentRoot "/Users/[my_name]/Sites/test"
<Directory "/Users/[my_name]/Sites/test">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Other notes
I've created a config file my user account in /private/etc/apache/users/
I've given that file read and write permissions to "everyone"
I've restarted apache after every save to any config file
I've reset the cache on my browser every time I make a change to these files
I have an index.html file set up in my /Users/[my_name]/Sites/test/ folder
When using the command sudo apachectl -t
Warning: DocumentRoot [/usr/\xe2\x80\x9c/Users/joshwoelfel/Sites/test\xe2\x80\x9d] does not exist
httpd: Could not reliably determine the server's fully qualified domain name, using Joshs-MacBook-Air.local for ServerName
Syntax OK
I don't know what to try at this point. I've spent several hours looking at tutorials and other questions people have posted. It looks like my files and permissions are correct!
I just resolved this issue. Try adding 'Require all granted' instead of 'Allow from all'.
<VirtualHost *:80>
ServerName test.com
ServerAlias www.test.com
DocumentRoot "/Users/[my_name]/Sites/test"
<Directory "/Users/[my_name]/Sites/test">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
when you set DocuemntRoot "/Users/xxx/xxx" on mac os, your must ensure your httpd User && Group have permission to read the directory.By default, /Users/xxx/xxx owner is root and group is admin, so you don't have the permission. If your directory group is wheel it maybe work.
Verify every directory in the path to your DocumentRoot, not just the DocumentRoot itself, is searchable (+x permissions) for Apache. Upgrading my Mac OS reset my home directory to 700 permissions. Changing this to 755 fixed the issue for me.
After the last upgrade to MacOS HighSierra 10.13.4 I had the same message. I've tried different solutions posted around but the what really tipped me was an article mentioning that when you get this message it's usually just a matter of permissions. So in the end I just needed to make sure that the group and the owner of both the document root, that I don't keep under my profile path, and the children directory are owned by the same user and group specified in httpd.conf, are set to my group and username. The default values in httpd.conf are: _www and wheel respectively. If you're unsure about your user name use
whoami
on a terminal window.
If you're interested in keeping your files under your profile directory this guide may help you.
I've installed OpenNMS (1.12.8) on CentOS 6.5 but I'm having a tough time getting the Web interface to run under SSL. I can start OpenNMS with it's default port setting of 8980, but when I attempt to modify the /opt/opennms/etc/opennms.properties file to listen on port 8443, it simply never works. According to the docs, it should work simply by uncommenting a single line of the config!
I can see port 8980 open via netstat, but I never see 8443. I can even change 8980 to 80 and it works as expected, so I think that the opennms.properties file is OK. At this point, I assume that there's something deeper that I'm missing regarding Jetty's configuration and HTTPS. Any thoughts?
I tried to enable SSL using the built in Jetty in OpenNMS and it didn't work either.
Right now I am running Opennms under SSL using apache.
What you need to do to achieve it is pretty simple:
First install apache.
Then configure your site's .conf file. Mine looks like this:
<IfModule mod_ssl.c>
ProxyRequests Off
# Rewrite http to https
RewriteEngine on
RewriteCond %{80} !^443$
RewriteRule ^/?(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L]
<VirtualHost *:443>
# General setup for the virtual host
DocumentRoot "/opt/opennms/jetty-webapps/opennms"
<Directory "/opt/opennms/jetty-webapps/opennms">
Order allow,deny
Allow from all
</Directory>
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite HIGH:!ADH
# Set up ssl cerfiticates
SSLCertificateFile "/home/ubuntu/2b0a025bef6e41.crt"
SSLCertificateKeyFile "/home/ubuntu/keyFile.key"
SSLCertificateChainFile "/home/ubuntu/gd_bundle-g2-g1.crt"
CustomLog /var/log/apache2/ssl_request_log ssl_combined
</VirtualHost>
</IfModule>
In the configuration file, you need to use your own DocumentRoot, Directory, as well as the directory for SSL cerfiticates.
Then enable ssl module and your site by running,
sudo a2enmod ssl
sudo a2ensite your-site.conf
Finally restart apache.
sudo service apache2 restart
I keep getting Access Forbidden Error 403 when I try running my installation of XAMPP on my MAC
I am running the project outside of /Applications/XAMPP/htdocs. It's in my /Users/my_user_name/Projects/ directory.
Every time I try and go to my virtualhost I get a 403 error: Access forbidden.
I have edited my httpd-vhosts.conf file and I have allowed Virtual hosts in httpd.conf.
I have also set the User and Group to User my_user_name and Group Admin in httpd.conf
I even tried chmoding all my files and directory 777 but I still get Access forbidden.
I have also change Deny to Allow in the httpd-xampp.conf file in the new security settings.
The erro_log provided by XAMPP doesn't mention the 403 error I do see it in my access log as 127.0.0.1 - - [21/Aug/2013:14:45:20 -0400] "GET / HTTP/1.1" 403 1034
I turned on errors and I am seeing this [authz_core:error] [pid 52813] [client 127.0.0.1:57473] AH01630: client denied by server configuration:
Not sure what else to check or try. Please help lol.
Just to have the answer right here:
You can permit access by adding Require all granted to each VirtualHost in your httpd-vhosts.conf:
# VirtualHost for my.site.com
<VirtualHost *:80>
ServerAdmin webmaster#site.com
DocumentRoot "/Users/me/www/my.site.com/"
ServerName my.site.com
<Directory "/Users/me/www/my.site.com">
ServerSignature Off
Options Indexes FollowSymLinks IncludesNoExec
AllowOverride All
#Order allow,deny <- You can remove this
#Allow from all <- and that
# Insert the following:
Require all granted
</Directory>
</VirtualHost>
Good luck!
I kept having this 403 issue and could not find an answer UNTIL...
Curly (right and left) quotes where in my vhosts file.
If you see something like "xe2\x80\x9c" in your error log then this is your problem.
I opened the httpd-vhosts.conf file in a reliable editor (I used Dreamweaver) and noticed that the quotations are curly ones (left and right quotes). They need to be straight quotes. The regular text editor on my Mac would auto change any quotes I make to these curly ones and I wasn't noticing it.
Hopefully this answer will help someone.
In my case problem was with user definition in
httpd.conf for Windows:
User daemon
Group daemon
Changed to
User myusername
And it worked
For linux:
User myusername
Group sudo
For OSX:
User myusername
Group admin
also you might have to set permissions on folder
sudo chown -R yourusername /Applications/XAMPP/xamppfiles/htdocs
I found something that actually fixed my issue at the following link. I hope this saves someone hours of pulling out their hair. lol
http://www.apachefriends.org/f/viewtopic.php?p=198815&sid=35790f5d017f27c93c1fd4d260b35128
I got this error because I forgot to set my 'DocumentRoot' url and my 'Directory' url the same.
#dl local
<VirtualHost *:80>
ServerName dl.local
DocumentRoot "/Users/myuser/dl_live" <<< ----- This URL has to match
<Directory "/Users/myuser/dl_live"> <<< ----- this URL
Options Indexes FollowSymLinks IncludesNoExec
AllowOverride All
Require all granted
</Directory>
ErrorLog "logs/dl.local_error_log"
</VirtualHost>
If you do this you may see an error like this in your error log file:
[Tue Feb 03 13:50:26.189944 2015] [authz_core:error] [pid 25254] [client 127.0.0.1:54841] AH01630: client denied by server configuration: /Users/myUsername/path/to_local/virtual_host/
I solved that problem by removing the standard virtual host in httpd-vhosts.conf
And leaving only the virtual host configuration that you want.
I'm running a XAMPP server on my laptop and I'm trying to setup a virtual host.
My hosts-file looks like this:
127.0.0.1 localhost
127.0.0.1 localhost.com
127.0.0.1 ehc.local
127.0.0.1 bal.local
The httpd-vhosts.conf file looks like this:
NameVirtualHost *:80
<VirtualHost ehc.local:80>
DocumentRoot "C:/wamp/EHC/src/main/php/www"
ServerName ehc.local
SetEnv APPLICATION_ENV "local"
<Directory "C:/wamp/EHC/src/main/php/www">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog "logs/ehc.dev-error_log"
CustomLog "logs/ehc.dev-access_log" common
</VirtualHost>
When I browse to 'ehc.local', I only get the default 403-error page.
How can I fix this?
Thanks!
This is for osx but must be the same (or similar) in windows:
Because Apache runs as the ‘nobody’ user by default, it may not have adequate permission to browse your [OSX/Win] user directory or some of its subdirectories, in which case you’ll see a 403 ‘access forbidden’ error when you try and view your development site. Similarly, you may find that although you can view your dev site, PHP throws errors when you attempt to write files or make directories on the filesystem.
To fix this you can configure Apache to run as your [OSX/Win] user. Open httpd.conf and look for the following lines:
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User nobody
Group nogroup
Change User to your [OSX/Win] username, and save the file:
User yourusername
Restart Apache and you should now be able to navigate your site without any issues, including manipulating files and folders using PHP.
Source
I Hope it will be helpful, Greetings!
Changing user didn't work.
For me it was this answer that did the trick:
Adding VirtualHost fails: Access Forbidden Error 403 (XAMPP) (Windows 7)
Just add Require all granted to your <Directory> setup and it should work as expected.
you should try this:
-> go to XAMPP folder,
-> open apache-conf-extra folder
-> open httpd-xampp.conf with the text-editor of your choice
Scroll all the way down until you find Deny from all and change that too Allow from all
I am reading a book about "Ruby on Rails" and now I have to deploy my application using Apache and Passenger. Everything seems to be installed properly but when I have finally add the following code in the Apache config file:
<VirtualHost *:80>
ServerName depot.yourhost.com
DocumentRoot /home/gotqn/Aptana Projects/depot/public/
<Directory /home/gotqn/Aptana Projects/depot/public>
AllowOverride all
Options -MultiViews
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
and try to restart the Apache:
$ sudo apachectl restart
I get the following error:
Syntax error on line 245 of /etc/apache2/apache2.conf:
DocumentRoot takes one argument, Root directory of the document tree
Action 'restart' failed.
The Apache error log may have more information.
The line 245 refers to the following line:
DocumentRoot /home/gotqn/Aptana Projects/depot/public/
Any ideas what I have done wrong?
Spaces are not allowed in this line, just put the whole path in double quotes
DocumentRoot "/home/gotqn/Aptana Projects/depot/public/"
You used spaces in directory path you need to escape the spaces or create path without spaces.
Instead of adding it to apache2.conf create one file(called newsite or something) in /etc/apache2/site-available and write the same thing in that file. And then run following commad:
sudo a2ensite newsite
Then restart server and add your server name to /etc/hosts