I am trying to access my localhost from another computer using the local IP(192.168...)
The problem is that I get access forbidden.
I changed the httpd-xampp-conf and it looks like the following:
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-st$ver- status|server-info))">
Order deny,allow
Allow from all
Allow from ::1 127.0.0.0/8 \
fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
fe80::/10 169.254.0.0/16
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
But still no luck...Any ideas..??
Whenever people on a linux system mention pre-packaged development environments I scream "ARRRRGHHHHHHH" at them and tell them that their computer is capable of running the same environment as production. Why are you running anything else?
sudo apt-get install php5 apache2 mysql
XAMPP is pretty terrible for dev environments. Set up an actual environment for your code; the experience is worth it.
Regardless, your issue is that XAMPP is bound to localhost, or 127.0.0.1. Change Listen 127.0.0.1:80 to Listen 80.
You could also try forwarding traffic, but that is a little bit overkill.
Also, your internal network (192.168.0.0/16) is only as secure as your router. If you feel comfortable allowing it, just bind XAMPP to your internal network address instead of 127.0.0.1 and allow everything globally. It'll save you a headache if you use different machines regularly.
Related
Hi I have installed bitnami redmine to use agile.when ever I am writing localhost/ or 127.0.01/ it is accessing bitnami home page to link for redmine.
I want to change it so that it can be used with proper port number , for example i am thinking to give port 1234, so that localhost:1234 will be my address for it.
I have seen and tried {HOME}/apps/redmineplusagileconf/httpd-prefix , to change the access for redmine , but still not able to change the access with custome port.
Any suggestion would help me.
HTTP Port
Under the default configuration, Apache will wait for requests on port 80. Change that by editing the httpd.conf file and modifying the value specified in the Port directive. For example:
Listen 1234
ServerName localhost:1234
Also change the port in installdir/apache2/conf/bitnami/bitnami.conf in the VirtualHost directive:
<VirtualHost _default_:1234>
HTTPS Port
Apache waits for HTTPS requests on port 443. Change that by editing the installdir/apache2/conf/bitnami/bitnami.conf file and modifying the value specified in the Port directive. For example:
Listen 8443
<VirtualHost _default_:8443>
In both cases, restart the Apache server for the change to take effect:
sudo installdir/ctlscript.sh restart apache
NOTE: On Linux and OS X platforms, install the stack as the root user
to use a port number under 1024.
I am running my website(www.example.com) using IIS server. Now my requirement is to run website (www.example.com) from Apache Server for PHP and www.example.com/XYZ url from IIS server for ASP .NET.
is this routing possible?
Do you mean on the same Windows Server? On port 80?
I think it's not possible to run two services on one port. The server has to process an incoming request on port 80 before deciding which service it is routed to, and then each service has to accept the request before resolving the domain name. The server and services and no way of knowing which process the request is meant for before it's too late.
If you don't mind running one of the web services on a non-standard port, it should work. Have you tried?
You can use the reverse proxy function on apache.
a2enmod proxy proxy_http
and then route /XYZ to the IIS server (or IIS port) in the apache config
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ProxyPass /XYZ http://old.iis.server/
ProxyPassReverse /XYZ http://old.iis.server/
</VirtualHost>
restart apache and it should work fine.
Edit:
If it has to be on the same physical machine, IIS must be "moved" to another port. Both services can't bind to port 80(HTTP)/443(HTTPS). This is simply impossible. One port - one service.
So, change the port of the IIS-Server to e.g. 8080 (HTTP) and 8443 (HTTPS)
and use
ProxyPass /XYZ http://localhost:8080/
ProxyPassReverse /XYZ http://localhost:8080/
I have a Drupal application that runs using the following command "drush runserver"
When I run this command, I get the following message: "HTTP server listening on 127.0.0.1, port 8888 (see http://127.0.0.1:8888/)"
If I visit that url, I see the application I am supposed to see, so that is good.
However, I am trying to create a vhost to this url as well as do some debugging on the application.
I've created vhosts many times before, but never for an application that lives on another port. After doing some google searches, I have placed the following in my httpd-vhosts.conf file:
NameVirtualHost *:8888
<VirtualHost *:8888>
DocumentRoot "/Users/justin/Sites/drupal/"
ServerName myproject.dev
ServerAlias www.myproject.dev
ErrorLog "/private/var/log/apache2/myproject.dev-error_log"
CustomLog "/private/var/log/apache2/myproject.dev-access_log" common
</VirtualHost>
I've also placed the following in my /etc/hosts file.
127.0.0.1 myproject.dev www.myproject.dev
And even after restarting my server, if I visit myproject.dev in my browser window, the browser just hangs. Like I said, I've never had problems doing this before, but I'm guessing it has something to do with the 8888. Any solutions for this?
Secondly, I am trying to set up debugging for my application in PHPStorm. Again, I have a feeling the reason I am having so much trouble is because of the 8888 port. I must be missing something that I usually do not have to set when I debug normally (port 80).
Here are my current xdebug settings in my php.ini file:
[xdebug]
zend_extension="/usr/local/Cellar/php55-xdebug/2.4.0/xdebug.so"
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host="127.0.0.1:8888"
xdebug.remote_port=9001
xdebug.remote_autostart=1
xdebug.idekey="phpstorm"
xdebug.max_nesting_level=1000
And I should mention that my debugger works with any random PHP file I make outside of the project. Again, I must be missing something with this 8888 port.
You are dealing with three different things here. First is the built in PHP web server that is spinning up with Drush. It listens on port 8888 unless you specify differently on the command line. Second is Apache and a vhost configuration. You can leave the vhost listening on port 80. The port is selected by the server not the application. You can run the server on port 16421 and your app will work just fine. Third is your xdebug config.
The only real problem I see is your xdebug config. You only need the remote host IP/hostname not the additional port. The port you have added there is the port used by PHP's built in web server. Xdebug runs on a different port which is defined in the xdebug config xdebug.remote_port setting. PHPStorm is going to be configured to connect to xdebug on that specific port, . Make sure the ports in PHPStorm and your xdebug config match.
If you have it configured correctly, it won't matter if you are using the built in web server or Apache, you will be able to debug.
This morning I started using HHVM as my default local server. Most things are fine, but I still have applications that HHVM doesn't fully support yet.
Rather than changing my configuration and restarting services, it would be much easier if I could just switch ports or directories.
My Question: Is it possible to run a normal Apache server on one port (80) and a HHVM powered server on another port (8080)? Alternatively, is it possible to only run HHVM in a specific directory (and its' sub-directories)?
In scenario 1 switching to HHVM application would look like this:
localhost/my-project/index.php
localhost:8080/my-project/index.php
In scenario 2 switching to HHVM application would look like this:
localhost/my-project/index.php
localhost/hhvm/my-project/index.php
I would guess that this can be achieved via Apache's config file, but I don't know enough about how the config files work to do it myself, please help!?
OS: Ubuntu 14.04
Apache Version: 2.4.7
HHVM Version: 3.2.0
To /etc/apache2/ports.conf add...
Listen 8080
Then, to your vhost configuration (since using localhost as your domain, probably /etc/apache2/sites-available/default.conf), copy everything in there and paste it right below so you have a second VirtualHost instance. To the second instance, change the *:80 to *:8080, then add your ProxyPassMatch to tell it you're wanting to use HHVM for hh and php file extensions (don't forget to update to correct directory).
It should look something like...
<VirtualHost *:80>
... keep the same ...
</VirtualHost>
<VirtualHost *:8080>
... keep the same ...
ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/$1
</VirtualHost>
Go into /etc/apache2/mods-available/hhvm_proxy_fcgi.conf and comment out what's in there. Otherwise everything will be headed toward HHVM.
Finally, restart apache
sudo service apache2 restart
I tested this quickly on an existing local site and it was redirecting back to 80 from 8080 which it should have done. If this doesn't work out, let me know.
UPDATE: Tested a bit more, and it looks like this should work out for you. After adding the following, jumping between local.site.com/hhvm.php and local.site.com:8080/hhvm.php flipped the echo correctly.
<?php if (defined('HHVM_VERSION')) {
echo "golden!";
} else {
echo "doh...";
}
Yes. You can have Apache listen on both port 80 and port 8080 (just add in additional listen configurations), then add a virtual host for localhost:8080 that passes requests off to HHVM through FastCGI.
We have dedicated windows server where IIS running in :80 and Wamp running in :85.
I successfully created a Virtual Host for wamp server which is running in :85.
NameVirtualHost *:85
<VirtualHost *:85>
ServerName www.my.tv
ServerAlias my.tv
DocumentRoot C:/wamp/www/alpha
ErrorLog "C:/wamp/www/alpha/logs/error.log"
CustomLog "C:/wamp/www/alpha/logs/access.log" common
</VirtualHost>
yes the above code is working & site is running only when i hit www.my.tv:85 but not in www.my.tv
can someone advice on the above where i could configure to make the site run at www.my.tv
If you configure Apache to serve your site on port 85 then the browser (which will default to port 80) won't find it unless you give it the port number it needs.
If you need to see the site on port 80 then you need to configure it on that port. Since you have another server running on that port it's not an option.
One possibility is that you create a virtual site on your IIS server for www.my.tv, but have it redirect to the site on port 85. You can do this in the properties box, on the Home Directory tab.