phpmyadmin domain name - apache

I have setup an Ubuntu LAMP server, and I have had phpmyadmin working fine with my website. However, I have recently had to create a virtual host for my IP address to avoid a security issue with directory listings in Tomcat, and now I can no longer access phpmyadmin.
It used to be at 192.68.1.99/phpmyadmin, and the actual phpmyadmin files are located in
/usr/share/phpmyadmin
I have a domain name pointing at my sever which I can use to point at phpmyadmin - how do I configure this?
thanks

Try to add
Alias /phpmyadmin /usr/share/phpmyadmin
To your global configuration or to virtual host which serves 192.68.1.99:80
This will allows you to access it again on URL http://192.68.1.99/phpmyadmin
If you want to setup phpmyadmin to be available using domain name, it is very same,
just put this line into VirtualHost settings of server under which you want to access it.
If you receive errors like access forbidden, add also following lines:
<Directory /usr/share/phpmyadmin>
Allow from all
Deny from None
Order Allow,Deny
</Directory>
<Location /phpmyadmin>
Allow from all
Deny from None
Order Allow,Deny
</Location>

Related

Can't access web services via IP but through the host names it does

I'm using a server 2008 r2. There I've installed Wamp on port 8080, SSRS on port 8063 and Some IIS sites on various ports.
I've installed CCproxy on the same server.
The funny thing is, I can't access them via server IP:port (192.168.8.100:8080) But I can, however, access it by Host:port (Mainserver:8080).
Then I thought it might be a clash between those services and installed wamp on a windows 8.1 computer and even that I can't access via the IP.
Please help.
Thanks
it looks like you are trying to access your website by using the local IP range 192.168.1.100. In some WAMP default configs, the devs have set the apache config to disallow access except from localhost.
Try to open the httpd.conf file located at
C:\wamp\bin\apache\apache#.#.#\conf\httpd.conf
Find the <Directory "c:/wamp/www"> block and replace the Order Deny,Allow and everything that follows with Order Allow,Deny followed by Allow from all. The end result should look like something similar to this:
DocumentRoot "c:/wamp/www"
<Directory "c:/wamp/www">
Options Indexes FollowSymLinks
Order Allow,Deny
Allow from all
</Directory>
To be safe, look into the virtual hosts config file and see if you find any Order Deny,Allow directives and replace them as well. The file is located at C:\wamp\bin\Apache#.#.#\conf\extra\httpd-vhosts.conf
You can read more about Order Directive from the Apache Documentation

Apache on Raspberry Pi deny/allow IP of directory

I know that this has been asked before but I just can't get it to work. What I want to achieve is to make it so that the index.php file and others in the /var/www directory can only be accessed when connected to my home network, but phpmyadmin is available through a server hosted on Weaved (weaved.com). Ideally it would make everything "private"(only accessible when on the home network) except phpmyadmin and the MySQL databases. When using the code bellow I can still acces the page from any IP address I like, why? Thanks in advance!
<Directory /var/www/>
order deny,allow
deny from all
allow from 192.168.0.240
</Directory>

How to serve sites from http://ip/folder?

Please help.
I'm trying to setup 3 test sites, so each could be reached from my server's ip like:
my-server-ip/site1
my-server-ip/site2
my-server-ip/site3
When I use ServerName as ip it works fine:
<VirtualHost 127.0.0.1:8080>
ServerName x.x.x.x
DocumentRoot "/home/myfolder/public_html"
<Directory "/home/myfolder/public_html">
AllowOverride All
</Directory>
</VirtualHost>
but using ServerName x.x.x.x/site1 is not working ofcourse.
I tryed to use Alias /site1 /path and it works for first virtual host but when i add 2 more virtual hosts to vhosts.conf only first works.
Another trick that i tryed is to add:
Alias /site1 /home/folder1/public_html
Alias /site2 /home/folder2/public_html
Alias /site3 /home/folder3/public_html
into /usr/local/apache/conf.d/domain-redirects.conf
and add options into /usr/local/apache/conf/httpd.conf
And this does work but not correctly.
I know I could use some domain name and setup a buch of subdomains for other sites..but using ip is better.
Is there a way to set things up this way?
You need to deposit your sites into the directory that the server accesses. The default that apache gives is /var/www. So if your file is at /var/www/test.html you can access it with 127.0.0.1:8080/test.html .
Thanks! Your idea led to solution. Just in case someone needs the same setup, here is what i've done (running on Centos 6 + Apache+Varnish).
Create and upload folders/files just like you do for normal domains.
By default http://ip -> my apache looks into a folder:
/usr/local/apache/htdocs
I could create a folder here and upload a site here but rather I've created a symlink to my testsite:
ln -s /home/user/public_html/test_site_folder testsite1
now my testsite is available at http://ip/testsite1
almost...to make it work for user I added in httpd.conf this statement (AllowOverride) in order to be able to use mod_rewrite and others in .htaccess located in root folder of testsite1
*** added
<Directory "/usr/local/apache/htdocs">
suPHP_UserGroup user user
AllowOverride All ***
Order allow,deny ***
Allow from all ***

how connect to phpmyadmin from other hosts

I have a lan network with 2 computer and installed wamp on computer 1.
now I want to access to whole of phpmyadmin on computer 1 from computer 2 and make changes.
from users tab in root of phpmyadmin page I created a user.
I filled username field with 'root' and host field with my computer 2 IP address and left password field with "no password" and checked all Global privileges for my user.
now I connect to wamp on computer 1 from computer 2 and click on phpmyadmin link.
but It give me this error:
FORBIDDEN
you don't have permission to access /phpmyadmin/ on this server
what I must do now for solving this problem?
change below line in C:\xampp\apache\conf\extra\httpd-xampp.conf, you can directly open this file by
<Directory "C:/xampp/phpMyAdmin">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require all granted
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
That error message has more to do with Apache blocking access, than with phpMyAdmin, or the MySQL user account created.
Your issue is with Apache's configuration, or more specifically your WAMP's configuration of the /phpmyadmin URL.
Find the configuration file where the \phpmyadmin URL Alias is set up. It possibly will have these lines in it -
<Location /phpmyadmin>
order deny,allow
deny from all
allow from 127.0.0.1
</Location>
Add another allow from IP.Address line in it to match the IP.Address of your other LAN system. Restart Apache.
If phpMyAdmin is not set up via an Alias (it is under WampDeveloper, not sure about other WAMPs like Xampp or WampServer), but is rather just a dump of its files in a DocumentRoot (website's webroot) sub-folder, check the .htaccess file there.
I filled username field with 'root' and host field with my computer 2 IP address and left password field with "no password" and checked all Global privileges for my user.
In this case, the host field will always be in relation to the location of MySQL, not to the system phpMyAdmin is being accessed from... If you are accessing MySQL via phpMyAdmin, the host field should always be - localhost. As phpMyAdmin is on the same system MySQL is. The only time you'd use another domain-name, host-name, or IP for host: is when you are accessing MySQL directly from another system. By directly I mean, not via a script or URL, but via some type of a client (which is almost always a binary/executable).
go to PHPMYADMIN.conf or search on it from wamp or wamp64
adjust on it as the following:
change
Require local
to be
Require all granted
And add your another client IP address after this line
Allow from localhost ::1 127.0.0.1
add this
Allow from CLIENTIPADDRESS
Restart Wamp or Wamp64
go to C:\wamp\alias\phpmyAdmin.conf
open phpmyadmin.conf in notepad
overwrite the below given code in it
<Directory "c:/wamp/apps/phpmyadmin3.3.9/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
change here is allow from all only..
First just check you have installed php, mysql and apache correctly.
Now if are you able to access phpmyadmin from your local host then above things are installed correctly. If you want to access phpmyadmin from another host, make the entry of 2nd host in following config file
/etc/httpd/config.d/phpmyadmin.conf
<Location /phpmyadmin>
order deny,allow
deny from all
allow from 127.0.0.1 <2nd host IP address>
</Location>
Then save you httpd settings and stop
service httpd restart
And now you are able to access phpmyadmin from another host

Allowing 0.0.0.0 access in WAMP

Everything is setup correctly, but I'm getting "403..... Forbidden You don't have permission to access / on this server." error's when I access my IP address or my TLD. Any help?
In your VirtualHost, make sure that you have access permissions set in the Directory block...
order allow,deny
allow from all
Check your DocumentRoot folder for an .htaccess file, it can override the above.
Aside from that, you can also get this error when your VirtualHost does not contain the proper ServerName or ServerAlias and the request ends up falling into the default httpd.conf setup.
Also consider trying out another WAMP package.
xampp (free) -
WampDeveloper Pro (commercial) -
WampServer (free)
You are probably making requests from ::1, which is IP6 127.0.0.1.
So just update your <Directory "c:/wamp/www/"> section at C:\wamp\bin\apache\ApacheX.X.X\conf\httpd.conf sections to:
Order Deny, Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Remember to also do it in all conf files of C:\wamp\alias
This way you preserve the apache security.