More than just repositories with VisualSVN Server? - apache

I recently installed VisualSVN Server and have several repositories migrated to the server. It works charmingly.
However, I was wondering, is it possible to host files that are not in a repository within the local network using VisualSVN Server in addition to the hosted repositories?
Specifically, All of my repositories are stored in the local directory F:Repositories they are accessible in a browser via "https://MyServer.com/svn/". What I want to do is leave the repositories mapped to that location so they are accessible as usual, but I also want to host files in C:\Data and/or F:\Data somewhere using the same instance of Apache. I would like to host it in either "https://MyServer.com/Data/" or something similar even as a subdirectory of /svn/. Can I do this and if so how?
I couldn't find any documentation on doing this. So I have tried editing the *.conf files that are used to configure Apache server in the VisualSVN Server in a number of ways, but have been entirely unable to make any headway.

The Apache HTTP Server instance of VisualSVN Server is isolated and is not intended to be used as general-purpose web server.
Check the disclaimer in %VISUALSVN_SERVER%\conf\httpd.conf:
# This is configuration file for Apache HTTP server which is
# part of VisualSVN Server.
#
# DO NOT EDIT THIS FILE IT WILL BE REGENERATED AUTOMATICALLY BY VISUALSVN SERVER
#
# Contact with VisualSVN Ltd. (support#visualsvn.com) if you have suggestions and
# improvements.
I suppose that you can complete the task that you describe by manually modifying %VISUALSVN_SERVER%\conf\httpd-custom.conf. However I strongly advise you to consider using separate web server for serving regular files, web pages, whatever.

Related

ImageResizer (as standalone image server) and backend image sources

Current Setup: Large CMS that has an "authoring" server and multiple "delivery" servers. Both the authoring and delivery servers are Windows servers running 64-bit Apache. The Apache Web root is setup on each server exactly the same--points to a directory on a SAN. The delivery servers are load balanced via another Windows server running Apache. I just finished setting up the ImageResizer server as a standalone image server and wanted to see what the best approach to getting the ImageResizer server to access and thus serve up the images.
authoring server - a.site.com
delivery server - d.site.com
image server - i.site.com
So I guess the question is, what is the best way to allow the ImageResizer server access to the images that are part of a large CMS site? RemoteReader plugin? Setup the IIS site with the Web root as the same as the authoring and delivery servers? Any security issues with this approach? Any suggestions/alternate approaches?
Thank you!
If the SAN is well-behaved, SMB2 or later, and low-latency, you could mount the directory as a virtual folder within the IIS root (which you might want to keep separate).
For performance, it would be best to disable FCNMode - http://imageresizing.net/docs/v3/docs/fcnmode - particularly if you have lots of directories in the SAN.
Alternatively, you could use RemoteReader and point it to your Apache web servers, although you'll sacrifice the ability to update existing files (RemoteReader perma-caches everything to make performance reasonable).

Using mod_security, either with Apache 2.4 or with mod_proxy as a reverse proxy

I would like to setup mod_security as a stand alone instance protecting Tomcat instances against web application attacks. Would anyone know the pros and cons of doing this via installing mod_security as an Apache module versus installing mod_security on a reverse proxy? Has anyone implemented mod_security in either of these fashions? And if so is one preferred over the other?
There's really no difference in your two options. What non reverse proxy would you install the module on to protect Tomcat?
The question doesn't really make sense as they are both the same to you.
If you already have an Apache server, then you install ModSecurity in one of two ways:
In embedded mode by installing ModSecurity as module in the existing Apache instance you already have. The advantages are that you won't have to set up a separate Apache instance, and that the ModSecurity will have access to the environment that Apache runs under (so can see environment variables for example or log to same log files).
In a reverse proxy mode. This involves setting up a separate Apache instance, with ModSecurity on it only, and funnel all requests through it, before sending on the requests to your normal Apache. The advantages here are a dedicated web server just for ModSecurity, so you will not share resources with your existing version of Apache, if it is already resource hungry. Disadvantages are that it doubles your infrastructure and the complications that brings.
Personally I prefer option 1.
However, as you want to set up a dedicated web server in front of TomCat, the two options are identical for you. The new instance of Apache (or Nginx) that you set up will be running it in embedded mode and will act as a reverse proxy to your Tomcat server.
Personally I always think it's best to run a dedicated web server like Apache in front of any app server like Tomcat - especially on a public facing website. Granted Tomcat does include a pretty good web server (called Coyote), which may serve most of your web server needs, but a dedicated web server like Apache is more geared towards serving static content and contains other features for performance and security which make it a better end point server (including the ability to run ModSecurity for example!).
And just in case there is any confusion, Apache is actually short for Apache HTTP Server, and is sometimes called Apache httpd after the process that it runs. It is Apache's most popular bit of software hence why the name gets shortened, but Apache actually have lots of bits of software (including Apache Tomcat - usually shortened just to Tomcat).

Installing OTRS on DreamHost

I'm using a Debian VPS on DreamHost and wanted to install a feature-rich customer issue-tracking system (not for software development like Bugzilla). OTRS made my shortlist and I followed the Installation Instructions through the "Web Server Configuration" step (/etc/init.d/apache2 restart), but the restart step reported failure. Nevertheless pgrep apache showed it was running. In fact, it turned out that although www.mysite/otrs/installer.pl was running, my regular website showed a page claiming it had no content (but when I looked in the website's folder, its content was fine, just not being served).
DreamHost Support was very helpful, but explained that they don't use the standard Debian Apache server for hosting websites and instead use their own. Specifically, the Debian server is in /etc/apache2, but the DreamHost server is in /dh/apache2. DreamHost Support determined that the OTRS installation instructions were configuring the usual Debian Apache location which somehow prioritized that server instead of the DreamHost server. They tried moving the otrs.conf file into /dh/apache2, but though the regular website was working again, the OTRS page wasn't.
Has anybody had success installing OTRS on a DreamHost VPS?
I've consulted one of our admins on this, and these are our suggestions:
You will either need to:
Adapt DreamHost's Apache build to incorporate the OTRS modifications
Get Debian Apache up and running
Both options will require an admin user and some knowledge of Linux command line and Apache management tools. You will also need to set your VPS to UNMANAGED, which means that any changes in the DH Web Panel to any of your domains will have no effect whatsoever. Just make sure the DNS records for any domains are pointing to your server. You will also need to be able to manage your own Apache configurations.
NOTE: This will also essentially mean that DreamHost support cannot and will not troubleshoot your domains. Unmanaged means unsupported in any way!
There are a few core differences between DreamHost's apache2 configuration and the default Debian build. The first issue I observe is that DreamHost's configuration does not allow for extra configuration files to be loaded in the manner that the OTRS documentation suggests. This means if choosing option 1, you will need to manually insert the OTRS directives into DreamHost's configuration files, which may prove difficult.
I would recommend moving or otherwise disabling the /dh folder entirely after setting your VPS to unmanaged. This will not allow DH-default Apache to start when the VPS starts. You may also need to remove the DH Apache startup script in /etc/rc3.d/S02httpd2 and the actual script at /etc/init.d/httpd2.
Once you have your own version of Apache running successfully, you might consider copying the VirtualHosts that were previously at /dh/apache2/apache2-ps/etc/httpd.conf into your own domain configuration files in your conf.d directory, or you can shuffle your website files around and configure your Apache to your desire.
Once you've got your own flavor of Apache running, you should be able to implement the OTRS instructions per their wiki. :)

How to configure apache to proxy requests

I want to add a javascript based chat system to my web app. I have read in many places that apache needs to forward(proxy) the requests to the xmpp chat server.
From what I have understood , I either need to add proxying support to apache server
OR use the jabberHTTPbind servelet.
I am trying the first thing. Add proxy support to apache. Now within Eclipse I am using Tomcat 7.0. I think this Tomcat comes with its own web server and is not using Apache. Is that true ?I am using Tomcat from http://tomcat.apache.org/download-70.cgi and added server in Eclipse by providing its extracted path.
I am not able to find any apache related folder structure eg(/etc/apache2/apache2.conf) within my Tomcat extracted directory.Also can't find httpd.conf anywhere .
Should I need to download apache separately and connect my tomcat to it.
I think adding proxy support to apache is required because javascript code won't be able to connect to any URL other than the current domain. so the question again is the same , where are all these apache2.conf and httpd.conf to add mod_proxy. and where can I do the virtual host mapping.
Any help to move ahead with be very much appreciated.
You need to install the Apache HTTPD server and enable reverse proxying. Read the doc on mod_proxy on how to do this. There are tons of resources on Stackoverflow as well; search for Apache reverse Proxy. The conf files you mention are part of the Apache HTTPD install.
javascript code won't be able to connect to any URL other than the current domain
That is generally true unless you enable CORS

Sub Directory to a different server

Is it possible to for a domain e.g. www.myclient.com to have a sub directory hosted on a completly different (our) server?
They don't want to point subdomain.myclient.com to our servers so they want it as folder www.myclient/subdomain/
Thanks in advance.
As discussed in the comments, your only option is a Proxy. Everything else (Like mod_rewrite / Alias) will do a header redirect, and expose the target address to the user.
However, Apache's proxying doesn't seem to be that complicated. The most basic example is
ProxyPass /mirror/foo/ http://backend.example.com/
Note that a proxy will of course double your traffic, because every byte requested will have to be fetched from the remote machine.
There are two different mechanisms that you might be able to use to accomplish this. What you use will depend on the setup you have as well as what permissions you have on the server from the hosting company if this is not a dedicated server.
The first option is to map to the second server using the file system, then use mod_alias to point the subdirectory to the mapped location. This requires that the two servers be networked together, for instance if you have one server dedicated to a specific server, but own and can safely network the servers at the file system level.
Another option would be to set up Apache to act as a proxy. This does require some advanced programming to configure but the system can be set up so that requests to the specified subfolder would be passed on to the remote web server. This can be used when the remote server can't be networked at the file system level, but lets you simulate the workings of a remote subdomain.
Could you use Amazon CloudFront because it can map different paths to differnt servers ?