MediaWiki installed on virtual server accessed through Apache ProxyPass - wiki

Note: where you will see "xttp" actualy is "http" but stackoverflow rules do not allow me to use more than 1 hyperlink in one post because I do not have enough "credit" to do that :)
INTRODUCTION
Hi,
I have installed a MediaWiki 1.15.3 software on a private LAN on a Linux box (CentOS 5), with: Apache 2.2.3, PHP 5.1.6, MySQL 5.0.45. Let's name this Linux box "wiki box".
Public users can't access this wiki as it is hosted on a private LAN.
For external users (the Internet users) we have a Linux router (with Apache 2.0.52) where we host our website (ex: xttp://www.cubique.ro). Let's name this Linux box "router".
WHAT I WANT
What I want to do is:
to create a virtual domain (as xttp://wiki.cubique.ro) on the "router"
setup the virtual domain to forward all xttp requests to my private "wiki box" (ex: xttp://192.168.0.200/wiki_root/)
WHAT I'VE DONE ALREADY
On router's Apache (httpd.conf) I have created a VirtualHost as:
< VirtualHost 0.0.0.0:80 >
ServerName wiki.cubique.ro
DocumentRoot /someinternalpath/html
ScriptAlias /cgi-bin /someinternalpath/cgi-bin
...
Well, after I have navigate at wiki.cubique.ro I saw a blank web page, as /someinternalpath/html has an empty index.htm page.
No problem, I know that I have to "teach" the router to pass all the access of virtual domain (wiki.cubique.ro) to the wiki box, where the real pages are stored.
So I teach the Apache to ProxyPass the access of virtual domain root to the wiki box root like this:
...the following lines lies in the same virtual domain definition, see above
ProxyPass / xttp://192.168.0.200/wiki/
ProxyPassReverse / xttp://192.168.0.200/wiki/
< /VirtualHost >
WHAT IS THE ISSUE
If I access the wiki using the internal address (such as xttp://192.168.0.200/wiki/) it looks splendid (style sheets, everything).
When I access the wiki using the virtual domain name ( xttp://wiki.cubique.ro ) it shows the content but no style sheet. Worse than that, no internal wiki links are working at all.
Make a try: http://wiki.cubique.ro
FINALLY, THE QUESTION
Anyone has a clue how to deal with this?
Thanks.

You should check your path variables in LocalSettings.php, especailly $wgStylePath and $wgServer

Related

Hiding Port number in Shiny Apps using Shiny Server

I have deployed an app using Shiny Server on AWS instance. When I run Shiny app, it launched itself at URL XXX.XXX.XXX.XXX/8787/p/1234. I need to share this URL with my colleagues, but I want to hide IP+port number where shiny server is running i.e. I want to hide XXX.XXX.XXX.XXX/8787, or at least one of IP/ Port should not be visible to them. Is there any way out of hiding this?
I want my colleagues to see something like XXX.XXX.XXX.XXX/shiny/p/1234 (port number hided) or shiny/p/1234 (IP+port hided). Any help would be highly appreciated.
you probably already find your answer.
But a way of doing what you want is to use
<VirtualHost *:80>
...
ProxyPreserveHost On
ProxyPass /shiny http://0.0.0.0:3838/shiny
ProxyPassReverse /shiny http://0.0.0.0:3838/shiny
ServerName localhost
</VirtualHost>
In your httpd.conf 'your server config file this exemple is for apache'
Then you Can Access to your app in
http://ip_address/shiny/your_app_name

Block access at folders starting with ~ and all of their folders/files

EDIT: The reason of my problem is mod_userdir. So if your host has enabled mod_userdir like Hostgator reseller package for example http://support.hostgator.com/articles/specialized-help/technical/apache-htaccess/mod_userdir then be sure that you host can disable this. Apparently Hostgator refused to disable this for the specific hosting package
Recently I received a phishing warning from google related to a file that doesn't exist in my server. The reason that it appears as it is hosted on my server is because I'm on a shared/reseller Apache hosting package. So I discovered that I can access any file of another website which is hosted on the same server as my site if I know the username of the owner of the website.
Meaning I can access
http://mywebsite.com/~somebodyelsesusername/any_path_to_their_files.php
Well this behavior is undesirable, so I want to deny access to other's websites through my domain using .htaccess
How can I block every root folder for instance mydomain.com/~somefolder/ starting with ~ without knowing what follows next? Of course I have to block access to any files or folders of that folder. I tried
<DirectoryMatch "^\~|\/\~">
Order allow,deny
Deny from all
</DirectoryMatch>
But I guess I'm not doing it right.
The answer below answers in fact the question however it doesn't fix my problem due to special circumstances. So I marked it as correct and I will further investigate the issue
<DirectoryMatch> can only be used in the server configuration file, or virtual host context, not through .htaccess.
You can possibly block access using mod_rewrite. Make sure the module is enabled, then use the following directives:
RewriteEngine on
RewriteRule ^~ - [F,L]

Open cart 2.0, in WAMP the basic ui is not visibile to the other pc

Hi i just installed openCart in my localhost, and in my computer everythings fine,
and after Putting online my WAMPserver
i am able to see my page using other computer by ip address
but the design or the basic theme,css of my open cart is not loading...
any idea?
thanks.
Go to your config.php files (both in the root and in /admin) and change all the URLs from (probably) http://localhost/ to the IP e.g. http://192.168.1.123/
Note: you will need to use the IP when browsing from BOTH PCs in future.
That's probably the simplest solution. Depending on your WAMP setup, you can also set up an alias in the vhost e.g. "myopencart" and then add an entry in your hosts file on each PC to map this domain to the correct IP.
In the vhost:
ServerAlias myopencart
Hosts file on the hosting PC:
127.0.0.1 myopencart
and on the other PC:
192.168.1.123 myopencart
Then you can hit myopencart in the browser instead, which is nicer than an IP. But meh, that's all it is... nicer.
If you need more help with that, just google "virtualhost wamp", there are a million guides out there.

VPS and WAMPSERVER

I have a vps server, i installed wamp server on it when i access
http://localhost/
it looks like this: See image
when i access the public ip address it looks like this: See image
when I access the private ip address on the VPS it looks like this: See image
And when I access Private ip address on my pc it looks like this: See image
My question is what I need to make to access wamp from my pc or outer the VPS?
WAMPServer is designed to be a developers tool to be used on a developers desktop PC.
For this reason it comes configured in a way that is designed to protect the newbie from themselves and therefore Apache is configured to only accept connections from the PC running Apache, for obvious security reasons.
If you want to allow access from other locations you have to change the Apache configuration.
The quick and simple, and of course most dangerous method is to use the Put Online menu option on the wampmanager menu.
wampmanager -> Put Online
That will change the Apache config ( httpd.conf ) to allow access from any ip adddress in the universe. That may not be what you really want to do so alternatively you can manually edit the httpd.conf file ( use the wampmanager menus to do this )
wampmanager->Apache->httpd.conf
Find this section of the file
# onlineoffline tag - don't remove
Require local
It may look like this is your have done a Put Online
# onlineoffline tag - don't remove
Require all granted
And change it to allow specific ip address's or address ranges into your system
A specific ip ( your PC lets say ) while you are developing, Add the line
Require from 111.222.333.444
You and a friend
Require from 111.222.333.444 222.333.444.555
A whole subnet
Require 111.222.333
Remember, you will not be adding your internal ip address, 192.168.?.? you will be using your routers WAMP ip.
Basically you should read this part of the Apache manual

Allow only users who have predetermined uname/passwd to reach a Django website

I have a Django applciation running on Apache with mod_wsgi, but I would like to create a development server on the same machine.
I can reach my website by http://IP_ADD and I would like to reach the development server from http://IP_ADD:8080 or another port.
But as you notice, I would like to prevent accessing to 8080 port from users who do not enter predetermined username/password.
How can I achive such protection? I may allow only certain IP address but it is not a solution.
Another question is also about the chosen port. I hace choice 8080 port but I will also setup issue tracking system, SVN etc. and I am not sure which ports should I open for them.
Thank you
For each of the sites you want to host, you could create a separate Apache site with a VirtualHost file along the following lines:
<VirtualHost *:8080>
ServerName www.example.com:8080 // Your name (if available)
ServerAlias 12.23.34.45 // Your IP
DocumentRoot /var/www/mydjangoapp // Your folder
<Directory />
Order deny,allow
Deny from all
Allow from 127
AuthName "Restricted area"
AuthType Basic
AuthUserFile /etc/apache2/users_mydjangoapp // Allowed users file
require valid-user
</Directory>
The userfile itself can be generated using Apache's authentication system. For each site, you could add a seperate user file to contain the access for that part of your system. For IP based access, just add lines like Allow from 123.123.123.123 below the Allow from 127 line.
Finally, additional sites can be created by creating more of these Apache sites (see for example here for more details). Just adapt the port (8080 in my example) to the one you want to host the additional sites under.
you can add basic authentication
http://djangosnippets.org/snippets/1304/