WAMP localhost and phpmyadmin setup - apache

I have inherited a WAMP setup, but needed my http://localhost to point to a different directory "C:/Users/[user.name]/htdocs" due to many dependencies.
I made the following changes in httpd.conf
DocumentRoot "C:/Users/[user.name]/htdocs"
<Directory "C:/Users/[user.name]/htdocs">
where the original path was "c:/wamp/www/"
Now the WAMP default path for phpMyAdmin http://localhost/phpMyAdmin is not working anymore.
Is it possible to fix that via either C:\wamp\alias\phpmyadmin.conf or httpd-vhosts.conf somehow?

Can I suggest a better solution to your requirement to have a site running that does not live in the WAMPServer default location i.e. \wamp\www or \wamp\www\somefolder
If you revert all your httpd.conf changes to the out of the box state and then create a Virtual Host to run the site you have located in your \user.... folder.
Virtual Hosts are a standard Apache feature that allows you to run may sites from a single instance of Apache, a bit like a shared hosting package setup.
You would then have the benefits of the WAMPServer homepage running on localhost and all the other alias's tools as well.
You can then run your site using a nice url for example sitename.dev and the virtual host definition also allows you to setup any site specific requirements without effecting any other site you may want to run.
There is a HowTo Setup Virtual Hosts here on SO

Related

Apache Virtual Host Configuration

I am using Apache 2.4 on Raspbian and I want to create a virtual host to serve files on my external hard drive on my website. I searched it on the internet and found many guides to make it but this seemed the simplest: http://www.thegeekstuff.com/2011/07/apache-virtual-host/
However, the files "httpd.conf" and "httpd-vhost.conf" which are mentioned in the guide do not exist in my system (I searched the whole system). Therefore I can't configure those files and hence, my virtual host. When I was searching the information about location of https.conf on the internet, I learnt that it does not exist anymore. However, I couldn't find the information about what to do in this situation.
I have been searching it online for hours but I couldn't find the answer. I do not know how to set up my virtual host. I would greatly appreciate your help.
Debian derivatives keep their config files in /etc/apache2/
To create a new virtual host, create a new config file in /etc/apache2/sites-available/. You can use 000-default.conf as a template (but you'll need to add ServerName directives as you'll be creating a specific default host rather than the fallback).
Then run a2ensite YOUR-CONFIG.conf to turn it on, and service apache2 restart to restart the HTTP server so it picks up the new configuration.

Https and http not working together on MAMP Pro

I created a host on Mamp pro using their GUI app which is called "site1". If I go to https://site1/, it is working fine. If I go to http://site1, then it loads the root of http://localhost.
Based on GUI,
http//localhost's document root is applications/mamp/htodocs/
http//localhost's document root is applications/mamp/htodocs/site1/
If I disable https, then the http site works correctly. I need the both protocol for the site. How could I fix that? Any help? I am also unable to recognize the correct httpd.conf files which are associated with these hostnames.
On the GUI management window, I just added the following code into the additional virtual host parameters and both http and https started working fine together.
ServerName site1
DocumentRoot "/Applications/MAMP/htdocs/site1"
It would still be good to know where and how MAMP is creating the conf files.

Host multiple domains with apache

I'm trying to set up an ubuntu server to act as a dns server and host a simple webpage, some git repos, and some software for issue tracking, code review, and the like. I settled on Phabricator as the issue tracking/ code review software of choice, since it seemed to be a good all-in-one solution. I've got my server hosting my webpage and git repos, so that part seems to be working ok. Now here's the issue I've run into (from Phabricator configuration instructions):
If you haven't already, set up a domain name to point to the host you're installing on. You can either install Phabricator on a subdomain (like phabricator.example.com) or an entire domain, but you can not install it in some subdirectory of an existing website
I have no idea where to even begin setting up another domain name on my server. How do I set up a second domain name for Phabricator to use?
I see a lot of guides online that say to modify resolv.conf to add a dns entry, however mine looks like this:
Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.1
and I'm not sure what I should change to get dns entries to show up here.
I'm assuming you have only one IP address, which means you should be using virtual name-based hosting. There are a number of tutorials for doing this, but in short:
Create a virtual host configuration file in:
/etc/apache2/sites-available
For example:
nano /etc/apache2/sites-available/phabricator
Run:
a2ensite phabricator (in this example, but use the configuration file name you used above)
apache2ctl restart
The configuration file (which can be named whatever you'd like) needs to contain a number of items. A simple example would look like this:
<VirtualHost *:80>
DocumentRoot /www/example1
ServerName www.example.com
</VirtualHost>
DocumentRoot is the full path to the root of your site, usually where index.html, index.php, or the like is located. The default is /var/www. You could put somethig like /home/phabricator or /var/www/phabricator, but make sure you install Phabricator in the directory you specify.
ServerName is the full FQDN of your site, such as "www.google.com" or "phabricator.yourdomain.com" or even "phabricator.local". Basically it's the same value as you have set in your DNS for your A record, or in your /etc/hosts file. If you don't know about /etc/hosts, then disregard that part.
You'll probably need a few more directives in your configuration file, but you can find what's available on Google. I would suggest following some tutorials to get your configuraiton right.
But overall, you just need to create a virtual host config file, enable it, then restart the server, which is what the above instructions do. Apache will respond to the web request based on the site you put into your address bar.
P.S. Just noticed your DNS part of the question. Do you have DNS set up publicly to point a domain (example.com) or subdomain (something.example.com) to your server's IP address?

where should i define my virtual hosts? conf/httpd.conf or conf.d/user.conf

i have seen more than one tutorial that i have been using trying to get suPHP running on my centos 6.5 box.
first off, standard lamp virtual hosts tutorials always add virtual hosts into /etc/httpd/conf/httpd.conf however, a different tutorial that i was looking at (http://invision-web.net/web/install-configure-apache-php-suphp-virtual-hosts-centos/) puts the virtual hosts into /etc/httpd/conf.d/user.conf
is there a right or wrong way to do this? is one better than another?
also, i understand that httpd.conf is the main apache config file, but what exactly is the user.conf file?
The virtual host configurations should normally go in main Apache configuration file httpd.conf. In the article link you posted above the configuration
creates a virtual host for user invision on domains
n1.invision-web.net and www.invision-web.net
. Unless you have multiple site users which require configuration at a per-user level, this is not necessary. The article does not make this clear at all.
user.conf is for per-user configuration. For example, where sites have multiple users (e.g. access to http://www.mysite.com/~pedro (delivering content from the home directory or sub-directory of user pedro) can be configured in the users.conf file. More details in Apache docs.

Hosting personal pages over a Redmine installation

I currently installed redmine on my server, and configured apache2 to run it in a virtualhost over mydomain.com
Thing is I also want to host some extra pages, at mydomain.com/personal, but since redmine is running the page is never found. How can I override this configuration to run both redmine and some personal pages?
You need the Alias directive to just create a virtual directory, which maps /public with some other real directory on the filesystem.