On a new Rackspace Cloud Server box (Ubuntu 9.10), I've installed apache2, libapache2-mod-mono, and mod-mono-server2. I've disabled mod_mono and enabled mod_mono_auto, but whatever I do, requests for Default.aspx return the actual contents of Default.aspx (in this case, "This is a marker file generated by the precompilation tool, and should not be deleted!")
I've installed XSP, and it looks like it works okay, but I'd like to use Apache with mod_mono (seems a more common configuration) if I can get it running. However, this is no error messages and no hints, with Google obviously not terribly helpful. What else can I look for to make sure I'm configured correctly? How can I test further?
I never did sort out the issue with mod_mono_auto (or MonoAutoApplication). I switched back to mod_mono, set up a mod_mono.conf with the following:
MonoAutoApplication disabled
Alias / "/var/www"
AddMonoApplications default "/:/var/www"
<Location / >
SetHandler mono
</Location>
...which is all the configuration I needed to do there. Working as designed for now.
Related
I wanted to use the wonderful dejavu software to audit a local elasticsearch instance.
Wondefull idea, but currently it looks that it's not easy as it should be. But I found a way to do it, and that's what I want to share with Community.
Basically you can run dejavu from the opensource.appbase.io but first you need to set SSL to access your local ES. Here is how I did it in less than 1 hour (saving you other 4 hours of googling/reasearch/try&fail).
This is little bit like issue https://github.com/appbaseio/dejavu/issues/106 but running it from the dejavu's website instead of local extension.
Just in case, I've tested this on Chrome and Firefox, both succesfully. I've done it all in Windows, but I suppose Linux should work because nothing described here is Windows-specific.
Bad news: the google extension fails (no idea because the error reporting does not exist)
More: I don't want to deal with Docker, that is the other "easy" way that is provided.
So this is what I did:
1.- here is the link to the main web site: https://opensource.appbase.io/dejavu/
2.- click to run it live. Here is the link: https://opensource.appbase.io/dejavu/live?default=true
It will start inmediately, but won't be able to get any data. Don't worry.
3.- point it to local, in my case was http://localhost:9200 plus my ES index document. Failed, but don't worry.
If you look at the console and network tools of your browser, dejavu looks to be trying SSL to connect with your ES. Here is where setting SSL on your ES (or in front of it) became required.
There are several ways to do this. In my case (because it was not for production) I've used Apache httpd, specifically the already packaged (portable) version of xampp, so it's just about minutes to have it downloaded and running. I donwloaded from here: https://portableapps.com/apps/development/xampp
4.- after installed Apache, open a new tab in your browser and try the SSL like https://localhost and it will give you a correct warning about the certificate. Just trust on it to check SSL is up and running. Don't worry about the warning.
5.- to set the SSL to redirect ES requests correctly, here you have these simple settings to add in apache config file, then restart apache. I took the idea from here: Elasticsearch with apache2 ssl proxy
<Proxy http://127.0.0.1:9200>
ProxySet connectiontimeout=5 timeout=90
</Proxy>
<LocationMatch "^(/_aliases|.*/_search|.*/_mapping|/_nodes|/_settings)$">
ProxyPassMatch http://127.0.0.1:9200
ProxyPassReverse http://127.0.0.1:9200
</LocationMatch>
6.- now it is required to set the cross-origin authorization at your ES. Add these lines into your elasticsearch.yml file and restart ES. The instructions comes from dejavu's github site: https://github.com/appbaseio/dejavu
http.cors.allow-origin: "https://opensource.appbase.io"
http.cors.enabled: true
http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization,Access-Control-Allow-Origin
http.cors.allow-credentials: true
7.- test how is it going: get your index mapping with something like this: https://localhost/your_es_doc_index/_mapping
You will get the JSON maping of your index. Everything is working (Apache and ES)
8.- now, in your dejavu, point it to https://localhost:443 (yes, the port must be set because if not it will assume to do https://localhost:9200, believe it or not). Don't forget to set your ES index document in the "header" box ni dejavu. Now click in "Connect".
After couple of seconds, you will have the list of your types ready and accesible in dejavu
I am setting up a mono server using Apache and mod_mono on the Raspberry PI 3 running Raspbian Jesse. I already have mono and mod_mono installed and functioning properly.
This is my desired folder structure
/var/www/html
App1
App2
I would like to configure Apache so that I can simply copy a new .NET mvc3 app into a folder directly beneath /var/www/html, (i.e. /var/www/html/App1), and each of those applications will automatically start working as MVC3 apps without having to add an entry to the apache config for each application.
MonoAutoApplication enabled does not work in this case because I am not serving .aspx pages (or any other .net file), but rather these are MVC applications.
The benefit of this approach is that I can keep this config file with each application in version control. Then when starting a server from scratch, there is less configuration that needs to be done when deploying the apps.
Any ideas on how to handle this?
A few assumptions are made here.
Apps will only be published directly beneath /var/www/html. For example, /var/www/html/app1, /var/www/html/app2
Each app will provide a mod_mono.conf file in its root folder. For example, /var/www/html/app1/mod_mono.conf
The mod_mono.conf for each app must know the absolute path to the app.
The apache server must be reloaded after deploying a new app. There's not really a way around this.
At the end of apache2.conf, add the following:
/etc/apache2/apache2.conf
#define the default mono server
MonoServerPath default /usr/bin/mod-mono-server4
#include all config files from all mono apps
IncludeOptional "/var/www/html/*/mod_mono.con[f]"
#prevent web access to mod_mono.conf files
<Files ~ "mod_mono.conf">
Order allow,deny
Deny from all
</Files>
and then for each application, add this mod_mono.conf, changing the path to the folder accordingly
/var/www/html/app1/mod_mono.conf
AddMonoApplications default "/app1:/var/www/html/app1"
<Location /app1>
SetHandler mono
</Location>
I have apache 2.2 with mod_wsgi handling /
WSGIScriptAlias / "...wsgihandler.py"
I have followed instructions to setup static file handling with AliasMatches and a matching directory configuration.
The website is working fine.
How can I determine that static content is served by Apache and not via wsgihandler.py
working? The apache access log file doesn't help me, even when I set it to debug.
I've tried to intercept and read traffic between Firefox and the server, but that didn't enlighten me either.
Work out what the URLs of the static files are and then comment out the WSGIScriptAlias. The URLs should still work.
Note that in general you would not use AliasMatch but just Alias. You might want to provide the appropriate parts of the Apache configuration so it can be reviewed to see whether you are doing it in the best way.
This is my attempt:
load the headers_module
and in
Header set MyHeader "Static content served"
Here is the situation: I was given a machine with a subversioned repository of an old website to update/add contents every now and then. The website is built using ColdFusion and Model-Glue MVC, AND I have no idea (zero) about ColdFusion. The other website we run is on CakePHP and that is good enough learning curve for me. ;(
With that said, I don't have a problem modifying it's contents because its all HTML and javascript. The problem is that with each minor change, I have to commit to the development repository on the server THEN go online to see how the change looks like!
It gets very frustrating just to try different values for a simple thing like the "height" attribute of an html tag!! And what frustrated me even more is trying to run a local copy on my machine for that repository!
What I tried so far:
I installed CF10 with WAMP.
Configured vhosts file for the new server.
Added my user to ColdFusion Application server service (windows 7x64)
But whenever I try to open it in the browser it gives me "Exception Service Error Application Exception"!! Any help please?
**Update: I forgot to ask! how to know the index.cfm file that the website starts with? For example, I know in CakePHP its app/webroot/index.php. What is that in (Coldfusion X Model-Glue)? there are so many index.cfm and application.cfm files!
my httpd-vhosts.conf block about this server is like the following:
<VirtualHost *>
ServerName localhost-CF
DocumentRoot "C:/wamp/www/my/webroot/directory/"
<Directory "C:/wamp/www/my/webroot/directory/">
Options Indexes FollowSymLinks Includes ExecCGI
allow from all
order allow,deny
# Enables .htaccess files for this site
AllowOverride All
</Directory>
# Apache will look for these two files, in this order, if no file is specified in the URL
DirectoryIndex index.cfm index.html index.php
</VirtualHost>
Here is a link to a Screen Cap --no enough rep ;{ -- of what I get using both servers (not at the same time though) apache and built-in:
CF10 Local Server Setup Issue
Also, here is a block from cfusion\logs\application.log:
"Error","ajp-bio-8012-exec-1","08/15/13","10:34:38","PREK","Error during init: Could not find the ColdFusion component or interface coldspring.beans.DefaultXmlBeanFactory. Ensure that the name is correct and that the component or interface exists."
"Error","ajp-bio-8012-exec-1","08/15/13","10:34:38","PREK","Error during exception service init: Element EXCEPTIONSERVICE is undefined in a Java object of type class [Ljava.lang.String;. "
"Error","ajp-bio-8012-exec-1","08/15/13","10:34:38","PREK","Error during application init: The datasource named cfclientstorage is not a valid client storage DSN. Define client storage DSN through the ColdFusion Administrator."
I do have cfclientstorage as a DSN storage and the Administrator tells me its verified!
However, I think, if this exact repository works fine on the server then I should not worry about the code! it most likely a system/server configuration or installation problem (on my local machine).
It looks like you're using ColdSpring. You need to login into ColdFusion Administrator and add a mapping to your ColdSpring directory for example:
/coldspring --> c:/ColdSpring
Also you will need to set a datasource to point to your "cfclientstorage" database. This is also in ColdFusion Administrator
I'm just a newbie for Apache. I just installed apache 2.2 on the FreeBSD box at my home office. The instruction on FreeBSD documentation is that I can change the DocumentRoot directive in order to use the customized directory data. Therefore, I replaced...
/usr/local/www/apache22/data
with
/usr/home/some_user/public_html
but something is not right. There's index.html file inside the directory, but it seems that apache could not read the directory/file.
Forbidden
You don't have permission to access / on this server.
The permission of
public_html
is
drwxr-xr-x
I wonder what could be wrong here. Also, in my case, I am not going to host more than one website for this FreeBSD box, so I didn't look at using VirtualHost at all. Is this a good practice just to change the DirectoryRoot directive?
Somewhere in the apache config is a line like:
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/usr/local/www/apache22/data">
You must change this path too, to make it work. This directive contains for example:
Order allow,deny
Allow from all
Which give initial user access to the directory.
one possibility that comes to mind is SELinux blocking web process from accessing that folder. If this is the case, you would see it in selinux log. You would have to check the context for your original web root with:
ls -Zl
and then apply it to your new web folder:
chcon whatevercontextyousaw public_html
Or, instead, if its not a production server that requires security (like a development machine behind a firewall), you might want to just turn selinux off.
Just one idea. Could be a number of other things.