I have a website set up on Azure which I'd like to deploy a PHP site to.
In WAMP I have the following vhosts config:
<VirtualHost *:9898>
ServerAdmin wayne#localhost
ServerName test.somesite.com
DocumentRoot "C:\wamp\www\somesite-ui\www"
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory "C:\wamp\www\somesite-ui\www">
AllowOverride All
Order allow,deny
allow from all
</Directory>
# Rewrite configuration
Include "C:\wamp\www\somesite-ui\rewrite.conf"
</VirtualHost>
This is because we're using Atsumi MVC
How can I configure the Azure website to use a similar config?
I am not sure that this answer will help you. But instead of just creating a php web site, you could create a VM first with any operating system, and enable http end points to the vm. Install Apache server on the vm and do the necessary configuration. ( Or you coudld simply install WAMP in it)
azure web sites has the address lite somthing.azuresites.net (not sure)
azure vm will have "somthing.cloudapp.net" so the domain name won't be a much problem for you.
I have written a blog post on How to create a VM on azure. You could use it if you like.
Related
I'm migrating legacy apps to docker and I need to "trick" php into thinking that it runs on the exact same environment as it used before.
Basically, the app used to run on an apache2 with mod_php and the PHP code does something somewhere that says "If you've been called with HTTP, set the link for the images to http."
My docker image is now accessible locally with http only. But I would like to still fake PHP into thinking that it has been accessed with HTTPS.
I suppose that Apache should rewrite the $_SERVER['HTTPS'] variable but I can't find in the documentation how I could do that.
Here is my current configuration for my app:
<VirtualHost *:8080>
DocumentRoot "/var/www/app"
<Directory /var/www/app>
Require all granted
Order allow,deny
Allow from all
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
On my CentOS Linux VPS I have full LAMP installed. I have a CakePHP website (and intend to add a few more) as a virtual host. I also have a web based bug tracker called MantisBT that is implemented in PHP. I'd like to set up my Apache configuration file (/etc/httpd/conf/httpd.conf) to index both side-by-side. My websites are not in DNS. I access them using the raw IP number.
Here's my directory structure:
/var/www/
MyCakePhPApp/
html/
mantisbt/
Here's what I have in my httpd.conf file:
# This makes my MantisBT work under http:/<my_ip>/mantisbt
DirectoryIndex index.php index.html
# This makes my CakePhP work under http:/<my_ip>
<VirtualHost *:80>
ServerAdmin webmaster#tecadmin.net
ServerName example.com
DocumentRoot /var/www/MyCakePhPApp
<Directory /var/www/MyCakePhPApp>
Allowoverride All
</Directory>
</VirtualHost>
With this my CakePhP is accessible as "http:/my_ip" but my mantisbt site is not accessible. "http:/my_ip/mantisbt" goes to CakePhP and says that controller is missing. If I comment out the entire VirtualHost, then Mantis is indeed accessible as: "http:/my_ip/mantisbt", but of course then my CakePHP site is not accessible.
Does anyone know how to get both these websites working side-by-side?
I'm setting a server where I will need to run Ruby On Rails 3 applications along with some PHP websites.
The server is a CentOS 5.8 machine running Apache 2.4.3.
The server is for testing and PRE-production, so performance is not an issue.
I'm using Phusion Passenger for the Rails apps, and I've created a bunch of virtual-hosts (with associated folders and DB accounts).
Then, I'm planning to use other v-hosts for PHP.
Is it possible? How should I proceed?
Thank you very much
details:
httpd.conf:
LoadModule passenger_module /app/auser/.rvm/gems/ruby-1.9.3-p286/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
PassengerRoot /app/auser/.rvm/gems/ruby-1.9.3-p286/gems/passenger-3.0.17
PassengerRuby /app/auser/.rvm/wrappers/ruby-1.9.3-p286/ruby
(...)
##
## Virtual hosts
Include conf/extra/httpd-vhosts-phpmyadmin.conf
Include conf/extra/httpd-vhosts-rails01.conf
Include conf/extra/httpd-vhosts-rails02.conf
Include conf/extra/httpd-vhosts-php01.conf
Include conf/extra/httpd-vhosts-php02.conf
....
Passenger-managed v-hosts will be like:
Include conf/extra/httpd-vhosts-rails01.conf
<VirtualHost *:80>
ServerName rails01.lcl
DocumentRoot "/app/auser/apps/rails01/public"
<Directory "/app/auser/apps/rails01/public">
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
PHP-based v-hosts will be like:
Include conf/extra/httpd-vhosts-php01.conf
<VirtualHost *:80>
ServerName php01.lcl
DocumentRoot "/app/auser/apps/php01/public"
<Directory "/app/auser/apps/php01/public">
Options FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Yes, Running Rack/Rails alongside PHP definitely works.
There is a really cool gem called rack-legacy which might be what you are are looking for. It allows you to execute PHP code hosted on your Rails application server through php-cgi.
Rack Legacy tries to provide interaction with legacy environments like PHP and CGI while still getting the Rack portability so you don't need a full Apache/lighttpd stack.
I have used for some experiments, and it seems is possible to have a wordpress running and served with the Rails app server without having to mess up with apache/ngix files.
UPDATE: My original question is below, but the code I posted with the question has been edited to the final working solution.
I am trying to run multiple sites on my MAMP development server. Some of the sites are wordpress sites that live in the htdocs in MAMP and some of the sites are django apps that live in a folder titled djangoprojects.
I have been trying to implement the solutions from these stack questions:
multiple django sites with apache & mod_wsgi
How do I run Django and PHP together on one Apache server?
but I have not been successful. I was able to run the django site on apache with the code you see in the first VirtualHost brackets (from the daemon process line onward) but then none of the php sites could be visited.
Help is greatly appreciated. I am new with this and I can't work out the errors.
Here is the code from my httpd.conf:
UPDATE: The code below works. Both the Django App and the PHP applications exist on the localhost server. The PHP related VirtualHost stuff was copied from further up in the MAMP httpd.conf file.
<VirtualHost *:80>
ServerName localhost:80
UseCanonicalName Off
DocumentRoot "/Applications/MAMP/htdocs"
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory>
<Directory "/Applications/MAMP/htdocs">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
WSGIDaemonProcess site1 display-name=%{GROUP}
WSGIProcessGroup site1
Alias /media/ /Users/sequoia/djangoprojects/dynamics/media/
<Directory /Users/sequoia/djangoprojects/dynamics/media>
Options ExecCGI
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias /dynamics /Users/sequoia/djangoprojects/dynamics/apache/django.wsgi
<Directory /Users/sequoia/djangoprojects/dynamics/apache>
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
A couple of problems to start with:
ServerName is mean to specify the host name not a URL path.
You should never set DocumentRoot to be where your Django site source code is.
I have installed Zend server and developed a sample application, and iam surprised when my application url could not open in the browser...
This is my url, related to my zend application:
http://localhost/app_name/public/controller/action/parameter
I got an error like: "The requested URL /app_name/public/controller/action/parameter was not found on this server".
When i read the quickstart guide from here, i learnt that i had to define a VirtualHost directive inside my httpd.conf file of Apache directory.
But to my surprise, i found the following lines already existing in my httpd.conf file:
DocumentRoot "C:\zend\Apache2/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
Could not understand what to do...
First of all , your document root was wrong.You are using forward and backward slash at the same time and accessing the localhost will take you to the htdocs not the virtual host.
Please follow these steps to create a virtual host or check your setting with these
Create a virtual hosts
<VirtualHost *:80>
ServerName cert.local
DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/cert/public"
<Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/cert/public">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Register with your operating system (for windows)
Go to c:\WINDOWS\system32\drivers\etc and add the following line
127.0.0.1 cert.local
Restart the apache server and in order to access the virtual host go to http://cert.local/
If you want to access the htdocs and zend at the same time then you have to create another virtual host pointing to the htdocs.
Here is some basic about Virtual hosting
http://httpd.apache.org/docs/2.2/vhosts/
Hope this will help..:)
Got it... In the VirtualHost definition mentioned in the quickstart guide in the above link, the DocumentRoot and Directory were configured to the quickstart application, and if the document root was mentioned only till "htdocs" by default (not till application name/public), the zend format url doesn't work.
As i have many zend applications in my htdocs, i had to make the paths of DocumentRoot and Directory till "htdocs" itself, as it will vary in future for each application. So i added the following lines in my httpd.conf file, to make my app url work. Now i can run any zend application without modifying the httpd.conf file.
(and i also had to tell to the client to add these lines in his httpd.conf file for testing the application :)
<VirtualHost *:80>
<Directory C:\zend\Apache2\htdocs\>
AllowOverride All
Allow from all
</Directory>
</VirtualHost>
Hope it helps someone.