Apache2 Config Public IP - apache

I've got Apache installed via XAMPP on my Windows machine, I've forwarded port 80 so that it's accessible from outside the local network, and everything is good.
However, I'm working with laravel and am trying to make it so that each of my sites are accessible via a different path.
For example, site 1's public directory would be C:\xampp\htdocs\site1\public which I would like to be able to access from http://<public_ip>/site1 or http://<public_ip>/~site1. Similarly, if I created another project, I'd like to be able to access it in the same way using an alias on my public IP address.
Would I use vhosts for this? Alias'? Or how would I accomplish it?
I'm new to configuring apache, I've tried reading the docs but they have only managed to confuse me even further.

You will have to modify your httpd.vhosts.conf file in the "config/extra" folder. Also you will have to modify the hosts file. I'm not sure where that is in Windows.
Here is something that might help.
http://sawmac.com/xampp/virtualhosts/

Related

Mod wsgi and apache configuration

I'm facing the following issue: i've a public web server running on a given URL, say, www.mysite.com.
It uses apache2.
I've developed a python web app and I want to make it publicly accessible.
Locally, I use the command
mod_wsgi-express start-server wsgi.py
to start the server and everything works.
However, I would like to link only a specific URL to my app, such as mysite/my_test, leaving apache2 serving all the other requests.
In other words, I would like to set the server URL for mod_wsgi-express to mysite/my_test port 80.
By default I get Server URL: http://localhost:8000, and I would like to change this.
I've tried the --mount-point option, but I didn't see any difference.
I know I can change the apache configuration and adding WSGIScriptAlias but I'm facing multiple issues, so I'm searching for a quickest and easiest way.
Hope this is clear.
Thanks.

Bitnami Trac apache set domain name

I recently installed Bitnami trac and now I want to access it using my domain name.
I've made the necessary changes to the apache config file (httpd.conf) found in C:\Bitnami\trac-1.0.5-0\apache2\conf\ directory. I've installed trac in port 8080.
So this is the only change I made.
ServerName trac.mydomain.com:8080
I had trac in another server before, and that time also this was the only change I made to get my domain work with it. But this time it doesn't work.
Can somebody please tell me where I've missed? Do I have to update any other place?
According to your comment, you can access the server fine by using the IP address, but can't access it at all when using the domain name. This sounds like it might not be related to Trac at all. Here are a couple of things to try:
Run "nslookup your-domain-name.com". You should get a result that says "Addresses:" and lists your server's IP address. If you don't (or if you get a "Non-existent domain" error), then your DNS server isn't mapping your domain name to your IP address correctly.
Look through Apache's various log files on your server and see if there is any evidence of your request ever reaching your server. Whenever I do this, I first change LogLevel to debug in the Apache config files so that I get as much output as possible (restart Apache after changing the config file). If a 'debug'-level log doesn't even show that Apache saw the request, then something between your server and your local system is causing problems (a firewall perhaps). If the Apache logs do show that the request made it through, then the problem is likely an Apache configuration problem and the log output should provide hints as to how to continue.
Try connecting via VPN and then accessing your server by domain name (not IP address). If you can access the server by IP but not by name, then the server may not know its own domain name.
Bitnami developer here. By default bitnami installations accept petitions from any IP so you don't have to set the ServerName.
Although, if you want your page to be accessible using trac.yourdomain.com, you should consider using apache virtualHosts, could you try to follow this documentation page?
https://wiki.bitnami.com/Components/Apache#How_to_create_a_Virtual_Host.3f

How to exclude subdomain directory from main website

I've setup a VPS with apache2.
I am using cloudflare for DNS management.
Now, I have my websites's files in "var/www/website" folder. Inside that, there is another folder for forum. like "var/www/website/forum" inside which there are all forum related files.
Now, suppose I have www.website.com pointing to "var/www/website"
and I also have a subdomain forum.website.com pointing to "var/www/website/forum".
What I want to do is make the files inside "var/www/website/forum" accessible via subdomain only. I don't want users to access forum via www.website.com/forum, but I want them to access it only via "forum.website.com"
What you need to do is set up what's called a virtual host. You would put your forum at /var/www/forum and website at /var/www/website.
inside /etc/apache2/sites-available, you'll need to add an additional configuration file for that site called forum.website.com.conf.
You'll then need to create a symbolic link to /etc/apache2/sites-enabled for that file so that apache sees it. From there, you reboot the server and are good to go.
Here's some documentation:
http://httpd.apache.org/docs/2.2/vhosts/
http://httpd.apache.org/docs/2.2/vhosts/examples.html
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts
This may be a bit different depending on the flavor of linux, but should be about the same. Control panels like Cpanel, Plesk and WebMan can make this process a bit easier by abstracting the configuration to a web control panel.
Hope this helps you.

Trying to Properly configure the mod alias in Apache

I'm running apache 2.2.24 on Max OS X 10.9.1. Currently, we have a network drive that we access all of our Git repos on at /Volumes/GitWebsites. I would like to configure Apache to serve our PHP based repos from that directory. So, localhost (or 127.0.0.1)/phpsite1/ or /phpsite2? etc. will serve sites from /Volumes/GitWebsites/phpsite1/ or /phpsite2/ in the browser. My two questions are:
Do I simply modify the server root or do I need to use the mod-alias in the httpd.conf file?
What are the permission setting I need to in order for apache to access /Volumes/GitWebsites ?
I've done configuration changes like this in IIS 7.5 and set up a NodeJS dev environment but still new to make large scale changes to Apache. Thanks for any help given.
If you are happy with serving the contents of /Volumes/GitWebsites as it is then it should be fine to point the document root at it. It's also makes it easy to add sites later.
However this could be troublesome later if you want to manage php configuration later on for the sites separately.

Using Alias in Apache ONLY if local directory not present?

We're running a reseller web host, and aliasing a particular directory for ALL the sites within. This is all happening through WHM/Cpanel, which could possibly complicate my question.
We want all hosts to run their "/concrete" directory through a shared location on the server. This is working fine by adding "Alias /concrete/ "/usr/local/share/concrete5/concrete-latest/concrete/" to the apache include editor in WHM.
However, if a local concrete/ directory exists within the particular webroot of the virtual host, we'd rather use that than "/concrete" globally. It would also be nice if we could make this alias change in the context of the virtual host, within WHM (and I haven't found a great way to modify virtual host sections in WHM without hacking a file that I don't believe we're supposed to hack.)
Thoughts?
A primitive, although probably quite effective solution might be to forget about the Alias directive and to simply rely on a symlink. A little shell script that creates those symlinks for you will simply fail if there is already something present that is called 'concrete'.