Set up RefineryCMS with Passenger - ruby-on-rails-3

I'm trying to get a RefineryCMS install running on my CentOS VPS (which has DirectAdmin installed, which I don't think makes any difference for my problem) but somehow I cannot get it to host.
In my httpd.conf I've added the following:
RailsEnv development
PassengerHighPerformance on
|?DOCROOT=/home/user/domains/domain.name/public_html/rails/refinery_test_install/|
The paths are all correct and my normal Rails 3 applications work perfectly when I put these lines in my httpd.conf yet now it will just load the index.html file I've put in the directory pure for testing.
Any ideas on how I could get this up and running?

I was totally missing I didn't forwarded passenger to Rails' public folder. The configuration works with the following docroot:
|?DOCROOT=/home/user/domains/domain.name/public_html/rails/refinery_test_install/public/|

Related

moving prestashop from normal Apache site to virtual host caused prestashop to stop working

I had a prestashop(1.7) site located to /var/www/html (centos 8, apache web server).
I created as per most commmon instructions two virtual hosts pointed to /var/www/sites
/var/www/sites/site1/html
and
/var/www/sites/site2/html
when i place an index.html file i can see both files (rather the hello world text).
but when i copy the whole prestashop to the /var/www/sites/site1/html it does not work. i get the 500 error.
the path in the ps_shop_url is / and the domain and domain_ssl is as it was before site1.(the virtual hosts work since I can see the index pages remember?)
what else shall i configure in prestashop files in order to be able to see the shop?
thanks and regards,
Alex
Make sure to clear the whole /var/cache directory after migrating the files,
if this doesn't help try enabling Prestashop dev_mode (https://devdocs.prestashop.com/1.7/basics/installation/configuration/)
or investigate your webserver error_log to see what's behind the error 500

Does Apache create .htaccess file on startup

Working with Docker and a PHP application. Something (assuming Apache) is creating the following .htaccess file in webroot on container start up.
/var/www/html# cat .htaccess
Deny from all
I delete the .htaccess file and my application works properly. Then shows up again when I start the container. This is a basic Debian Stretch / Apache / PHP 7 image with my PHP code added to it.
Looking for reason or module that is doing this.
Edit: The Dockerfile https://pastebin.com/VDTFYJ0X
Apache is not automatically creating .htaccess files.
I highly assume that your problems is caused by docker.
Try checking your Dockerfile.
The program creating .htaccess file is Composer. Note this issue:
https://github.com/composer/composer/issues/5816
Best to set COMPOSER_HOME to something other than the web root.

How to change the apache user for a virtual host in Centos 7?

I am trying to set up a web server on Centos 7. I have created a virtual host by editing /etc/httpd/conf/httpd.conf. The root directory of the virtual host was set to /var/www/html/domain.com. I am able to open domain.com in the browser with no issue.
However, when I use get_current_user() in a PHP file to test what user the server is running under, the output is "root" which is a security concernt.
How do I change the user of the virtual host? When I set up a similar scenario in Ubuntu, I used apache2-mpm-itk module and configured the virtual host with "AssignUserID your_username your_username" and it did the trick. But I don't know how to do it in Centos.
Thanks
You can try to use SuexecUserGroup for that.
I found this method from plesk's configuration.
<VirtualHost *:80>
<IfModule mod_suexec.c>
SuexecUserGroup "anyuser" "anygroup"
</IfModule>
/VirtualHost>
In CentOS, this command gives you the file's owner, not the owner of the process ID. Something like that. It's in the PHP manual. Check out the comments at the bottom. get_current_user() By the way, check your User and Group directives in the httpd.conf and in httpd-vhost.conf. Also, use ps -faux to get a clear idea of the process spawning relationships between the httpd binary and the children it spawns. Just trying to help. ;-)
Also, check out How Apache Starts at the top of this page to make sure you understand how Apache is supposed to work by default. If yours in not working this way, that may be a good thing to know!! ;-)
In CentOS 7 you can use the httpd-itk package. It is in the EPEL repository, so you need to add that first. Something like this should get it:
yum install epel-release
yum install httpd-itk
Once installed you need to load the module by uncommenting the LoadModule line in:
/etc/httpd/conf.modules.d/00-mpm-itk.conf
Restart the httpd, and then you can use the new AssignUserID directive inside your VirtualHost sections.
have you looked into which user/group is specified in /etc/httpd/conf/httpd.conf? It would look something like this:
User apache
Group apache

WAMP localhost and phpmyadmin setup

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

Mono and Apache are serving files with no ASP.NET processing

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.