Note: It was tough deciding whether this belonged here or ServerFault, but it seemed like a programming problem, so if it's out of place, feel free to migrate it.
I downloaded the sandbox of Symfony 1.4.8 and copied the files to my webserver. Unfortunately, when I try to access /symfony/sf_sandbox/web/ (where I installed it), I get the following:
It seems like the images aren't showing. According to the text:
If you see no image in this page, you may need to configure your web server so that it gains access to the symfony_data/web/sf/ directory.
However, when I try to locate the folder referenced above, it does not exist:
sf_sandbox
web
css/
images/
js/
uploads/
frontend_dev.php
index.php
robots.txt
As you can see, there is no sf/ directory under web/. What am I doing wrong?
Note: I am installing this on Ubuntu 10.04 64-bit using Apache.
All the images are located in the Symfony source directory.
I would try creating a symbolic link in the web folder called sf pointed to the following:
lib\vendor\symfony\data\web\sf
It should have access to the needed images at that point.
This is done by indicating the right path in the Alias directive in your apache configuration:
# Be sure to only have this line once in your configuration
NameVirtualHost 127.0.0.1:8080
# This is the configuration for your project
Listen 127.0.0.1:8080
<VirtualHost 127.0.0.1:8080>
DocumentRoot "/home/sfprojects/jobeet/web"
DirectoryIndex index.php
<Directory "/home/sfprojects/jobeet/web">
AllowOverride All
Allow from All
</Directory>
Alias /sf /home/sfprojects/jobeet/lib/vendor/symfony/data/web/sf
<Directory "/home/sfprojects/jobeet/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
Just replace "/home/sfprojects/jobeet" with your project's path and it should work.
This page shows the apache config to set up a new project correctly.
There are also important security notes for your webapp.
Symfony Documentation
All you need to do is copy the whole sf folder to the web folder. In my case i copied c:\wamp\www\jobeet\lib\vendor\symfony\data\web\sf\ to c:\wamp\www\jobeet\web. Hope that makes sense
Related
hi I have many sites that I want to test on local, so when I edit the files on auto virtual host files under Apache->sites-enabled->file name, after reloading laragon, the file resets to its original default contents, ex-
Original
<VirtualHost *:80>
DocumentRoot "C:/laragon/www/cast.see.tech/public"
ServerName cast.see.tech.test
ServerAlias *.cast.see.tech.test
<Directory "C:/laragon/www/cast.see.tech/public">
AllowOverride All
Require all granted
</Directory>
edited
<VirtualHost 192.168.1.101:80>
DocumentRoot "C:/laragon/www/cast.see.tech/public"
ServerName cast.see.tech.test
ServerAlias *.cast.see.tech.test
<Directory "C:/laragon/www/cast.see.tech/public">
AllowOverride All
Order Deny,Allow
Allow from all
Require all granted
</Directory>
I cannot save any rules, any code, it comes back to its default original content once I restart laragon server. I am using windows 11, but the same problem I face on windows 10 also.
I tried uninstalling and installing back, but still no luck. Currently i am using latest version of laragon 5.0.0 210523, I also tried downgrading the version but still the same problem. Is it a windows issue or do I need to do something else. Please help me with this issue.
Each project has each own Virtual Host file located in:
For Apache:
{LARAGON_ROOT}\etc\apache2\sites-enabled\auto.{project}.test.conf
For Nginx:
{LARAGON_ROOT}\etc\nginx\sites-enabled\auto.{project}.test.conf
Content of a .conf file is auto generated. If you have a specific project which has modified content, just remove the auto. prefix from config file names eg : auto.example.test.conf => example.test.conf , Laragon will keep the content of the .conf file intact.
Virtual Host content is configurable, you can change it by modifying the template in:
{LARAGON_ROOT}\usr\tpl\VirtualHost.tpl
https://laragon.org/docs/pretty-urls.html
Laragon uses a template to auto-generate the virtual hosts.
On windows, the file is located at C:\laragon\usr\tpl\VirtualHost.tpl, assuming you installed it in C:\laragon.
Just edit this file and make the changes you want.
Keep in mind that all your sites will now use the same configurations.
One change I personally make is to remove the *. from ServerAlias, as I use subdomain format for my sites. Before I remove it, subdomain.example.com would always redirect to example.com.
So I have been following a tutorial on how to do this.
I zipped everything but my public folder.
uploaded and then unzipped files in the folder before the /www folder.
Uploaded the .env file separately since no hidden file got uploaded.
put public folder into my subdomain folder. I editted the index.php appropriately to go to the right directory.
Now I am getting a blank page on the site. Into my SSH I see the files including artisan but when I do php artisan nothing happens. Even when I do php artisan tinker nothing happens.
I'm not sure what is going on... What is wrong?
Laravel public folder serves the content of your website. the entire framework and vendor directory are behind this path. so public users cannot access all those folders its primary security for the framework.
It means on server you don't upload the entire framework to public_html folder and don't point the domain to public folder of laravel without setting proper symlink.
This point can be done with symlink creation in servers. for example you can edit the host file in Linux/Windows and set the project domain. something like homestead.app. Then in your apache configuration simply set this project domain to its physical path. like below.
<VirtualHost *:80>
ServerName homestead.app
DocumentRoot /home/User/Development/homestead/public
<Directory />
Require all granted
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
</Directory>
</VirtualHost>
So you can access the project in browser like homestead.app for more details check this link.
Hope its clear now.
I recommend putting all of your code together then creating a sym link to your public folder in your subdomain folder.
I'm running El Capitan and trying to get my website hosted locally for development with Apache (that came with the OS). I followed the instructions here exactly. I made an anthony.conf file and put the Directory text in there, I replaced the actual directory with /Users/anthony/dev/web/unfinished-asteroids/ and then placed my web files in there. I started apache and navigated for localhost/~anthony but I get the
Not Found: The requested URL /~anthony was not found on this server.
standard 404 error. When I navigate to localhost it works fine and I get the "It works" from the index.html that is located in /Library/WebServer/Documents, I even changed that index.html file and it works fine.
Any ideas why I'm not able to see my website using apache? All I did was download this github repository and place it in my unfinished-asteroids folder, the index.html is at the root.
So it looks like there are a couple of extra steps that you need to do. There isn't really anything too special about apache that comes with OSX, so your standard apache configurations will work. but to get Userdir (~username) working on El Capitan,this is what I had to do
Edit /etc/apache2/httpd.conf
on (or near) line 166, uncomment
loadModule userdir_module libexec/apache2/mod_userdir.so
then on line 493 uncomment
Include /private/etc/apache2/extra/httpd-userdir.conf
then edit file /etc/apache2/extra/httpd-userdir.conf
uncomment line 16
Include /private/etc/apache2/users/*.conf
then in /etc/apache2/users/anthony.conf
<Directory "/Users/anthony/Sites/">
Options Indexes MultiViews
Require all granted
</Directory>
then sudo apachectl restart
That should make http://localhost/~anthony point to your sites directory.
Logs are stored in /var/log/apache2
Now if all you want is web access to say your dev directory you can do something like this.. (don't make any of the changes listed above)
in /etc/apache2/other/ create a file called mydev.conf (name doesn't really matter, save it needs to end in .conf')
and put this in that file
Alias /dev /Users/anthony/dev/
<Directory "/Users/anthony/dev">
Options Indexes MultiViews
Require all granted
</Directory>
and reload apache (sudo apachectl restart)
then you will be able to access your dev folder at http://localhost/dev and should be able to access your page at http://localhost/dev/web/unfinished-asteroids/
you can adjust the paths at will above, just need to make sure that the user or group _www has access to it, and that paths in the alias and the directory match.
I have my own old django project which has not been created through django 1.4.1. I want to host it on ec2 bitnami so that inspite of running default htdocs folder my desired folder must be displayed. I have done this before but this time with new machine its not running. I have been go through this link
http://bitnami.org/forums/forums/djangostack/topics/getting-started
and was already all that. My changes what i have are..
In httpd.conf
In myproject_cofig.conf
WSGIScriptAlias /fortis_django "/opt/bitnami/apps/django/conf/fortis_django_wsgi.wsgi"\
<Directory '/opt/bitnami/apps/django/conf'>
Order deny,allow
Allow from all
</Directory>
In myproject_wsgi.wsgi
import os, sys
sys.path.append('/opt/bitnami/')
sys.path.append('/opt/bitnami/projects/')
sys.path.append('/opt/bitnami/projects/fortis_django')
os.environ['DJANGO_SETTINGS_MODULE'] = 'fortis_django.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
And location of project is checked and its correct..
In httpd.conf i changed..
DocumentRoot "/opt/bitnami/projects"
Include "/opt/bitnami/apps/django/conf/fortis_django_config.conf"
And redirected also..
RedirectMatch /fortis /fortis_django/login
So, whenever i go to myurl/fortis it come myurl/fortis_django/login with error too many loops. I am stucked from days please help to run my own project from my location. Thanks in advance.
Try:
RedirectMatch ^/fortis$ /fortis_django/login
Your existing pattern will not match what you are redirecting to.
I was running with MAMP for a while but then got to thinking that it wouldn't hurt to get into the bones of Apache itself.
So the default options worked great for me, even enabled a couple of virtual hosts too and they work great. However, I can't get Apache to support my htaccess files.
This is my Apache config https://gist.github.com/1332527 with my virtual host config as well https://gist.github.com/1332542
My sites work at min.local/index.php/some-url for example but fail at min.local/some-url where I get a 404. I've read a number of blog posts about setting AllowOverride to All in httpd.conf but it hasn't made a difference.
My .htaccess file is fine, it works in production.
Any suggestions?
Thanks,
Steven
Also, make sure to look at your user-specific conf file, located at /etc/apache2/users/username.conf and set your AllowOverride there.
The settings there will override the defaults in httpd.conf
just set it to All or whatever you have in httpd
I suspect the AllowOverride None in the virtual host file is overriding the AllowOverride All in the main config file. Try changing it to All and see what happens.
I had exactly the same issue. In my vhost block I had to add
<Directory "{webroot path}">
AllowOverride all
Allow from all
</Directory>
On restarting apache (sudo apachectl restart) all was good.