mod_proxy missing in apache2 installation - installation

I have an issue with my apache2 configuration for HHVM.
I'm on Debian 7.
The problem is verry simple : mod_proxy are missing in my apache2 installation (/etc/apache2/mod-availables/).
I've reinstall apache2 a several time but nothing do to mod_proxy is still missing, i've try to enable it manually but still the same error.
I must have the mod_proxy and mod_proxy_fcgi files !
Here is the error :
apache2: Syntax error on line 249 of /etc/apache2/apache2.conf: Cannot
load modules/mod_proxy.so into server:
/etc/apache2/modules/mod_proxy.so: cannot open shared object file: No
such file or directory
My apache2.conf is unchanged.
Here is my etc/apache2/sites-available/hhvm.conf
ServerName hhvm.com
DirectoryIndex index.php
DocumentRoot /var/www/dev
ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/dev/$1 retry=0
The last solution i still have is to compile from source apache2 ...

Related

After upgrade to macOS Sierra Apache can't do start/stop/restart

After upgrade to macOS Sierra Apache can't do start/stop/restart.
Errors:
AH00557: httpd: apr_sockaddr_info_get() failed for MacBook-Pro-N.local
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
I tried reinstall apache24 using home-brew. But it didn't fix my problem.
Also I configured httpd.conf, uncommented ServerName localhost. But it didn't help anyway.
Please, help.
try adding
127.0.0.1 MacBook-Pro-N.local
to your /etc/hosts file
Another solution is to change ServerName to localhost.
So first you need to find the location of your httpd.conf Apache configuration file by:
apachectl -t -D DUMP_INCLUDES
then edit it and uncomment or change the line with ServerName (make sure it has the valid server name or it exists in your /etc/hosts file). E.g.
ServerName localhost

Apache 403 Error with HTTP not with HTTPS

I've got a very strange issue with Apache:
I'm running Apache/2.2.22 + with PHP 5.5.27 (dotdeb.org) under Debian 7.8.
I made an upgrade of PHP, I'm not sure if it's related but I restarted Apache and suddenly all HTTP stuff ceased to work, only HTTPS requests are correctly handled, VirtualHost config of port 80 is no more working correctly, it seems like Apache is not getting the right DocumentRoot (403 on / and file not found for subfolders and files) if I use a HTTP URL (OK for HTTPS stuff).
sites-available/default syntax is OK, suexec and open_basedir paths updates didn't help.
It's not related to IP (it's not fail2ban, checked on other devices)
It's not the permissions or an Apache running user problem (I tried everything).
I even uninstalled (purge) and reinstalled libapache2-mod-php5.
Nothing worked.
Any clue ?
Thanks
Ok I figured it out, it's not PHP, it's the virtualhosts I created using Virtualmin, here's the fix:
Disable the NameVirtualHost lines in /etc/apache2/apache2.conf
Replace <VirtualHost XX.XX.XX.XXX:80 [XXXX:XXXX:X:XXXX::]:80> by <VirtualHost *:80> in all /etc/apache2/backup/sites-available/ conf files
Add NameVirtualHost *:80 at the top of /etc/apache2/sites-available/default file

After Install Laravel 4 on Ubuntu 12.04 the requested URL / was not found on this server

I Installed Laravel 4 on Ubuntu 12.04, I follow these steps from -
http://www.dev-metal.com/install-laravel-4-ubuntu-12-04-lts/
www.dev-metal.com/install-laravel-4-ubuntu-12-04-lts/
Activate mod_rewrite
Install the mod_rewrite module (or extension or whatever it is) and restart the Apache:
sudo a2enmod rewrite
sudo service apache2 restart
Open the default vhost config file:
sudo nano /etc/apache2/sites-available/default
DocumentRoot /var/www
<Directory /var/www>
and change them to
DocumentRoot /var/www/public
<Directory /var/www/public>
than Install Laravel 4
cd /var/www
wget https://github.com/laravel/laravel/archive/master.zip
unzip master.zip && cd laravel-master/ && mv * ../ && cd ..
rm -r laravel-master && rm master.zip
Run the installation with Composer by
composer install
and restart the server:
sudo service apache2 restart
than successfully installed and message :
but when I'm trying to run another web project for example
http://localhost/demo
than error comes like :
Not Found
The requested URL /demo was not found on this server.
Apache/2.2.22 (Ubuntu) Server at localhost Port 80
Add the following to your apache directory configuration.
AllowOverride All
go to the httpd.conf file of the server and remove hash (comment tag) from line showing below
LoadModule rewrite_module modules/mod_rewrite.so
it may be created from server side.
That is because your DocumentRoot is now set to /var/www/public which, i think where your problem is. Try putting your demo project folder inside the public folder then, try again. If it is a route, add it to /app/routes.php

How to redirect requests from apache2 to tomcat7 on Amazon EC2 Ubuntu12.04 when installed using apt-get command

I installed Apache2 and Tomcat7 on Amazon EC2 Ubuntu12.04 using command:
sudo apt-get install apache2
sudo apt-get install tomcat7
Now for tomcat
CATALINA_HOME is /usr/share/tomcat7 (bin and lib folders of tomcat)
CATALINA_BASE is /var/lib/tomcat7 (webapps folder is in there)
For Apache
Apache modules : /etc/apache2/mods-enabled
virtual hosts : /etc/apache2/sites-enabled
configuration file : /etc/apache2/apache2.conf
Apache configuration file httpd.conf is empty.
How can I redirect all request from Apache2 to Tomcat7?
Means for Example if I enter 10.121.143.116:80 in browser, it will hit 10.121.143.116:8080
Kindly suggest as I am finding on google since last 2 months and found too many solutions all mix up and not able to understand single best working solution.
Hope this will help.
First, create sampleweb file in /etc/apache2/sites-available
sudo touch /etc/apache2/sites-available/proxy_your_sampleweb
Second, add the following in above sampleweb host file.
sudo vi /etc/apache2/sites-available/proxy_your_sampleweb
#For forwarding everything
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
Third, enable sampleweb site
sudo a2ensite proxy_your_sampleweb
Forth, reload apache2 configuration
sudo service apache2 reload
Fifth, access your tomcat app using 80 port.
http://<>/
if you want to redirect only specific context like sampleweb, you can customise the above to limit only your sampleweb request to tomcat.
sudo vi /etc/apache2/sites-available/proxy_your_sampleweb
#For forwarding only required contexts
ProxyRequests Off
ProxyPass /sampleweb http://localhost:8080/sampleweb
ProxyPassReverse /sampleweb http://localhost:8080/sampleweb

VirtualHosts does not work on Mac OS 10.7

I want to create VirtualHosts on Mac OS 10.7 and therefore I edited the /etc/apache2/httpd.conf. I uncommented the line "Include /private/etc/apache2/extra/httpd-vhosts.conf" to include the virtual hosts. In the file /private/etc/apache2/extra/httpd-vhosts.conf I wrote the following:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/var/www"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/someFolder"
ServerName myApplication.dev
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/someOhterFolder"
ServerName myApplication2.dev
</VirtualHost>
There were two example virtual hosts before which I deleted. In my /etc/hosts file I added the following:
127.0.0.1 myApplication.dev
127.0.0.1 myApplication2.dev
I restarted my Apache and typed myApplication.dev and myApplication2.dev in the browser but I get an error "server not found" and it makes www.myApplication.dev in the browser (the same for myApplication2.dev).
Did I forget something to configure? I activated PHP in httpd.conf, mysql is installed also, but that has nothing to do with virtual hosts, I think.
Thanks for your help!
apachectl has an option -S to check vhost.conf file syntax. You can find these lines in vhosts.conf file.
> # You may use the command line option '-S' to verify your virtual host
> # configuration.
So, when you run
sh-3.2# apachectl -S
if you get Syntax OK result it means that there is no problem in your vhosts.conf file.
httpd: VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server zz.xxxx.com (/private/etc/apache2/extra/httpd-vhosts.conf:27)
port 80 namevhost zz.xxxx.com (/private/etc/apache2/extra/httpd-vhosts.conf:27)
port 80 namevhost yy.xxxx.com (/private/etc/apache2/extra/httpd-vhosts.conf:35)
Syntax OK
If conf file has any problem it will tell you error line(s) like
sh-3.2# apachectl -S
Syntax error on line 33 of /private/etc/apache2/extra/httpd-vhosts.conf:
CustomLog takes two or three arguments, a file name, a custom log format string or format name, and an optional "env=" clause (see docs)
make sure that your vhosts.conf file has true configuration.
I had the exact same problem using OS X Lion. I fixed it by adding "::1 myhost.dev" to /etc/hosts:
127.0.0.1 myhost.dev
::1 myhost.dev
Incidentally, the ::1 also fixes a bug that makes page loading very slow on virtual hosts served from the Mac.
Are you using an HTTP proxy? If so, make an exception for myApplication.dev and myApplication2.dev.
What I meant was that the problem "server mot found" means that your browser cannot find the ip adresses of the hosts "myapplication.dev". This may be because you're using an http proxy, possibly one configured by your hosting company. In any case, you don't even reach the server, so you never get to try the virtual host configuration at all.
To just try the virtual host configuration, you can use telnet in a Terminal window and talk HTTP directly to the server, like this:
yourmacbox:~ yourname$ telnet 127.0.0.1 80
You should see the following text:
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Then you type
GET / HTTP/1.0
Host: myApplication.dev
Now, hopefully you should see some response from your web server. This shows that once you can connect to it, the virtual hosts things works.
I had the same problem, and noticed that the ServerRoot "/usr" was set as shown and incorrectly after the 10.7 upgrade. The httpd.conf file was still under /etc/apache2, but this setting in it was pointing to the wrong place. Once I had fixed that by changing to ServerRoot "/etc/apache2", all my previous virtual host configuration got picked up properly.
I also had to re-enable virtual hosts by uncommenting line 477 as mentioned here http://brettterpstra.com/fixing-virtual-hosts-and-web-sharing-in-mountain-lion/ That didn't quite kick in until I had fixed the path issue above.

Resources