Can't configure XAMPPto work with zend - apache

Hi I'm trying to install ZF 1.12 with XAMPP .I read everything and did everything exactly as it was written,also configured the "httpd.conf" file like this:
<VirtualHost *:80>
DocumentRoot "/xampp/htdocs/<Your project folder>/public"
ServerName <Your project folder>
ServerAlias www.<Your project folder>
SetEnv APPLICATION_ENV "development"
<Directory "/xampp/htdocs/new/public">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
but now when i try to start the server i get the following message:
500 Internal Server Error
The server encountered an internal error or misconfiguration and was >unable to complete your request.
Is there anything else that needs to be done

Your Virtual Host definition is incomplete i.e no closing tag ( this may just have been missed when you copy/pasted.
Lets assume you have created and installed the Framework into /xampp/htdocs/project1/public
Lets also assume you want to run this site from a development domain called project1.dev i.e this is what you want to enter into the browser address bar.
Lets also assume you are using Apache 2.4.x and therefore need to use the Apache 2.4 syntax for access.
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/project1/public"
ServerName project1.dev
ServerAlias www.project1.dev
<Directory "C:/xampp/htdocs/new/public">
DirectoryIndex index.php
AllowOverride All
Require local
</Directory>
SetEnv APPLICATION_ENV "development"
</VirtualHost>
Now you need to edit the C:\windows\system32\srivers\etc\hosts and add these 2 lines.
127.0.0.1 project1.dev
::1 project1.dev
Now run this from a command windows launched using "Run as Administrator"
net stop dbscache
net start dnscache
And then restart Apache. Alternatively, just reboot.

Related

VirtualBox Ubuntu 16.04 apache2 vhost jumping to https or not showing the page

I am trying to set up some vhosts on a Virtual Box with Ubuntu 16.04 Apache2 PHP 7.0 to start moving the code to PHP7.
I have moved the v-host file from the older VBox which looked like this
<VirtualHost 192.168.2.174:80>
ServerName admin.ubuntu16.de
ServerAlias admin.ubuntu16.de
ServerAdmin email#company.de
DocumentRoot /home/www/public_html/workspace/admin
php_value auto_prepend_file '/home/www/public_html/workspace/admin/administration/conf/register_globals.php'
<Directory /home/www/public_html/workspace/admin>
Options Indexes FollowSymLinks MultiViews ExecCGI
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
But it kept on trying to load the page with https or saying that there is no access to site root folder
These settings work perfectly on Ubuntu 14 Virtuall Box with apache2 and PHP 5.5.something
So I followed the tutorial and changed it to simply
<VirtualHost 192.168.2.174:80>
ServerName admin.ubuntu16.de
ServerAlias admin.ubuntu16.de
ServerAdmin email#company.de
DocumentRoot /home/www/public_html/workspace/admin
</VirtualHost>
But now it just jumps straight to https mode
I obviously ran a2ensite
I also switched off the default site by running "a2dissite 000-default.conf"
I also enable modules to do with proxying and a bunch of others while getting appache to actuallly start :-)
Any ideas on things I might off missed are greatly appreciated.
Just a little edit:
All the files for the sites are situated on the main Windows machine and are imported through /media/sf-workspace
The symbolic link is then created as /home/www/public_html/workspace
I would first eliminate the symbolic links and just make a copy of all the files inside the virtual box to remove that variable.
Apache can be screwy with symlinks.

Setup Rails 4 with passenger for local development in localhost/rails_app

I can't believe that it turned out to be so difficult, but I need to be able to run my rails app at localhost/rails_app for development reasons, without breaking other applications I have. (localhost/php_app, for example)
I've followed a lot of tutorials, but I still can't get it working.
I have passenger installed and I think the missing step is to properly configure a VirtualHost.
(Mac OS X, Rails 4, Apache)
Edit: The big problem is that I can't run in localhost:3000 or any other port
Edit2:
With this in the apache configuration file:
<VirtualHost *:80>
ServerName localhost
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location /my_rails_app/ >
ProxyPass http://localhost:3000/
ProxyPassReverse http://localhost:3000/
</Location>
</VirtualHost>
The application runs on localhost/my_rails_app/ but it still uses localhost/ as the base url, missing every asset and making all the links wrong.
First off, on a local system you can just use the built-in test server that comes with Rails. Here's a virtual host that I use on a ubuntu server to run Rails:
<VirtualHost *:80>
ServerName errandlist.com
ServerAlias www.errandlist.com
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /var/www/errandlist/public
RailsEnv production
<Directory /var/www/errandlist/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
</Directory>
</VirtualHost>
And you are going to need to enable Passenger in your httpd.conf:
# Ruby Passenger support
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.19/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.19
PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-1.9.3-p448/ruby
It will be very similar on OSX, your versions may vary.
Edit: here's a question about running the test server on port 80: How to run rails s -p80 on 80 port?
I just use this script to run on localhost from the command line for debugging purposes for a project known as "priority_tree":
c:\ruby\bin\ruby C:\web\priority_tree\script\server -e test -p 3000
Then just open up IE or Edge with http:\localhost:3000 to test the program's operation.
You have to have dns setup to access a sql server or other database instance if you use it, but otherwise this should work.

vhosts dont appear to be working on OS X Mavericks Apache installation

I am trying to set up the Apache server which comes with OS X Mavericks with vhosts so that a domain name resolves to my user level document webroot. I have followed this tutorial which guided me through setting up the apache server with php:
http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-9-mavericks/
as well as this one which guided me through setting up the vhosts:
http://coolestguidesontheplanet.com/set-virtual-hosts-apache-mac-osx-10-9-mavericks-osx-10-8-mountain-lion/
Following these tutorials, if I type localhost in my browser it correctly resolves to the system level root (/Library/WebServer/Documents/ folder). If I use localhost/~myusername it correctly resolves to my user level root (/users/myusername/Sites/).
However, whenever I navigate to my domain, I get redirected to the system level root rather than my user level root.
My vhosts file reads as follows:
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Library/WebServer/Documents/
</VirtualHost>
<VirtualHost *:80>
ServerName mydomain.com
ServerAlias www.mydomain.com
DocumentRoot "/Users/myusername/Sites/mydomain"
<Directory "/Users/myusername/Sites/mydomain">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
Any ideas?
Have you enabled Virtualhosts?
NameVirtualHost *:80
And included your vhosts directory
Include <path>/vhosts/*
On a Macbook, you may need to include /private/ at the beginning of any absolute path, so that Apache can read it correctly off the file system.
For others who have the same problem...
It was frustratingly simple - I had missed the "" around the localhost directory.
How annoying!
Try starting apache manually with the -S option to see what the problem might be:
/usr/sbin/httpd -S

Rails: Vhost config for Apache and Passenger

I'm trying to get a simple Rails 4 app deployed on my server which already has Apache2 and is hosting several other sites and services (ie there are several vhost configs under sites-enabled). I've had some problems doing this on my local machine as well as my test server so I'm trying first to get it working on an AWS t1.micro instance with only one vhost config. I've written a script to do most of the heavy lifting for me which is on my github at rails-apache-passenger.
I have two vhost config files in the repo and have tried to get one or the other working. The script just copies over and enables one at a time.
Using the my-ruby-app-basic or the my-ruby-app vhost config I navigate to http://54.xxx.xxx.xxx/my-ruby-app/ but all I see is "The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved." When I go to ttp://54.xxx.xxx.xxx/ I just get the default apache2 page ("It works!").
My /var/www/my-ruby-app/log/production.log shows
I, [2014-01-24T10:47:36.900542 #9612] INFO -- : Started GET "/my-ruby-app" for 80.81.17.94 at 2014-01-24 10:47:36 +0000
F, [2014-01-24T10:47:36.902169 #9612] FATAL -- :
ActionController::RoutingError (No route matches [GET] "/my-ruby-app"):
So clearly I need to modify my routes.rb file, but what am I supposed to change? As you can see from the script in the git repo, it's just the default routes.rb from rails new. I just want to see the default rails app landing page at this point so I'm not sure what to do to the routes.rb file.
Here are the vhost configs
my-ruby-app-basic
#This is the config suggested by the passenger module after it finishes compiling, modified for 'my-ruby-app'
<VirtualHost *:80>
ServerName www.my-ruby-app-host.com
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /var/www/my-ruby-app/public
<Directory /var/www/my-ruby-app/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
</Directory>
</VirtualHost>
my-ruby-app
#Based on Apache section of Passenger documents
<VirtualHost *:80>
ServerName www.my-ruby-app-host.com
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /var/www/
<Directory /var/www/>
Allow from all
</Directory>
Alias /my-ruby-app /var/www/my-ruby-app/public
<Location /my-ruby-app>
PassengerBaseURI /my-ruby-app
PassengerAppRoot /var/www/my-ruby-app
</Location>
<Directory /var/www/my-ruby-app/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
</Directory>
</VirtualHost>
Using Apache and Passenger is a short term solution but I want to know how to do it in any case (The long term view is that I want to maintain compatibility with Jruby and just run our app through Tomcat or Glassfish, which will no doubt be another Apache config debacle ;-) )

Add new virtualhosts on Apache without restarting server?

I've got Apache working properly, virtual hosts work as expected.
My operating system is Windows 7.
However, I've got one problem, which I'm trying to find the answer to, and Google didn't yield much - for Windows anyway, only for Linux (which is not really applicable in this case).
How do I add new virtualhosts without restarting the server constantly?
(Apache version 2.2 is what I'm currently running)
I add new hosts to the host file and files in vhosts, like so:
<VirtualHost *:80>
ServerName host1.tld
ServerAlias www.host1.tld
DocumentRoot /www/vhosts/host1.tld
ErrorLog /www/Apache22/logs/error.log
<Directory "/www/vhosts/host1.tld">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
<VirtualHost *:80>
ServerName mywebsite.com
ServerAlias www.mywebsite.com
DocumentRoot /www/vhosts/mywebsite.com
ErrorLog /www/Apache22/logs/error.log
<Directory "/www/vhosts/mywebsite.com">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
Has anyone been in a similar solution, and if so, what's your advice?
You may be able to configure all vhosts with a single block, using VirtualDocumentRoot
<VirtualHost *:80>
UseCanonicalName Off
VirtualDocumentRoot /www/vhosts/%0
ErrorLog /www/Apache22/logs/error.log
<Directory "/www/vhosts">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
You can restart apache without restarting the server. I have an apple script on my mac that restarts apache for me so that with one click and a quater of a second the new apache configuration can be loaded. Here is the apple script which can easily be ported to Python(for your Windows use):
set stopString to do shell script "sudo /usr/local/apache2/bin/apachectl stop" with administrator privileges and password
set startString to do shell script "sudo /usr/local/apache2/bin/apachectl start" with administrator privileges and password
if startString as string = "" then
"Apache started correctly"
else
stopString & " , " & startString
end if