I'm running a Yii app with Wampserver, I pulled it from a git repository so it had no assets folders, I had to manually create each one because it was throwing a CException.
Now when I load any page Yii creates some folders with random names inside my assets folders, but they're all empty. Edit: Just noticed one of the folders created is full of files, but the other is totally empty and that's where it is trying to load all bootstrap files.
I've tried deleting them again but I have the same result, also tried adding SAFE_MODE in php.ini, running wamp as admin and adding this in the apache conf:
<Directory "*/assets/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
I read the 'Understanding assets' post but the only useful thing I found was:
It's important that the directory be writable by the webserver user so
that Yii can publish the resources there when needed
Yet I can't find how to do it for Wampserver
So, what am I supposed to do?
Thank You
I just found out what was going on, the application is using a bootstrap component which has an "assets" folder as well, since git was ignoring that folder it was empty and the component wasn't able to publish the files in the application assets. I just put the original component files inside that folder and the problem is now solved.
Related
I'm trying to make apache run on Linux Subsystem for Windows.
So I just installed apache and changed DocumentRoot from "/var/www/html" to "/var/www" in /etc/apache2/sites-available/000-default.conf.
This has exactly the effect I wanted it to have, namely to list all folders inside when browsing to "localhost".
My projects are located on my Windows drive in "C:/Projekte", so I created a symlink like so:
sudo ln -s /mnt/c/Projekte /var/www/projects
Now my problem is, when I browse to localhost and click on projects it runs into a loop trying to call an index.html, so the url before it breaks looks like this:
http://localhost/projects/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/
I would want to see the directory listing of my folders instead.
I know about the Options Indexes and FollowSymLinks which are both set, but there seems to be something else I have to set for symlinks to work as I expect.
If I create a folder instead in "/var/www" it works fine.
Does anybody know how to set this up correctly?
By accident I found out, that my issue here is related to this issue on BashOnWindows. Problem is that I used tab to autocomplete the path which automatically added a trailing slash to the end of the path. So the actual command I used to create the symlink was
sudo ln -s /mnt/c/Projekte/ /var/www/projects
Creating the symlink without trailing slash, just like in my question it works just fine.
So I have a Laravel 5.2 project on GitHub that works perfectly on my localhost using MAMP. Now I want to deploy that project in Digital Ocean. I've used a LAMP stack and configured everything (I think). Phpmyadmin is installed as well.
I followed most of the steps highlighted in this article: http://davidmyers.name/post/laravel-on-digital-ocean but some don't apply since I think its for Laravel 4 because the Laravel 5 structure is different.
I ran composer install after cloning the repository to install the dependencies
I created the .env file to include the MySQL database info on the DO Server.
I ran the following two commands to change permissions on the project folder:
sudo chmod -R gu+w www and sudo chmod -R guo+w www
Now I am able to see the public Laravel HomePage without issues:
However, when I try to access the different API routes that have been defined in the local version I have running, I get a 404 Error on the page:
Any idea what might be causing this issue?
Thanks in Advance!
I found the answer to my issue on this thread: https://laracasts.com/discuss/channels/laravel/why-do-i-always-get-a-404-error-for-any-route-i-create?page=1
Basically I needed to modify my apache settings on the conf file. My conf file was located here: /etc/apache2/sites-available/000-default.conf
I modified that file to include this:
<Directory /var/www/yoursite.com/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
After I modified that, the routes now work perfectly.
Sounds like a rewrite problem. Did you setup the .htaccess files correctly in the root and in the public folder of your project?
This is going to read similar to the other Trac static resource issues I found (pretty well encompassed by this SO question), but this doesn't appear to be the same issue.
I have partial (non-root) access to a server with other Trac projects, and I have the ability to create my own Trac site. The server has the following software versions:
Python 2.7
Trac 1.0
mod_python 3.3.1
So I've created and have been using the site for a few weeks, but I can't get the logo or the favicon to show up. There is another Trac project to which I have access, and to make sure I wasn't missing anything obvious I compared the trac.ini files from both projects. The relevant sections have very similar settings, e.g.:
[header_logo]
src = site/my_logo.png
[project]
icon = site/favicon.ico
and those are both sitting in their respective Trac environments' htdocs folders:
/
opt/
trac/
trac_env_1/
htdocs/
my_logo.png
favicon.ico
trac_env_2/
htdocs/
my_logo.png
favicon.ico
However, the images only appear on one site but not the other. On my site Google Chrome says:
GET https://{Intranet URL}/trac/{my_trac_env}/chrome/site/my_logo.png 404 (Not Found)
I have tried the following, all of which have been unsuccessful:
Setting the width and height inside [header_logo] to the correct dimensions
Copying the exact same images that work on the other project over to my project
Changing site/favicon.ico to /favicon.ico and /favicon.ico? (as suggested on the Trac wiki)
Running trac-admin deploy . in place, copying the images to htdocs/common, and changing the trac.ini setting to common/my_logo.png
Changing site/my_logo.png to /images/my_logo.png and matching that folder structure in my trac environment.
Making an htdocs/site/ folder and adding the logo to it (which, I know, is what other people did wrong, but I'm banging my head against the wall here).
The only thing left I can think of is Apache settings, but from what I can tell it should handle whatever Trac environments it can find in /opt/trac. In /etc/httpd/conf.d/trac.conf, it has:
<Location /trac>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /opt/trac
PythonOption TracUriRoot /trac
PythonOption PYTHON_EGG_CACHE /var/trac/egg-cache
</Location>
That it uses TracEnvParentDir instead of just TracEnv is the important bit, I think.
So, I am at a loss. Please, can somebody help me?
Gah, I knew I was missing something simple.
The problem was file permissions. Apache did not have read access to my Trac environment, so a simple chmod -R a+rX /opt/trac/trac_env_2 solved it.
I guess that's another answer to the "My static files won't show up in Trac" question:
Don't make an actual folder named "site" in your Trac environment; site/my_logo.png will look in trac_env/htdocs
Make sure your server knows where to find your Trac environments. Both mod_python and mod_wsgi settings for this are easily found.
Make sure your server has read access to your particular Trac environment (chmod a+rX to give directories-only execute permission)
Just posting here in case anyone else runs into a similar issue.
Yii question.
On my development machine, the required JQuery files for the application were present in a subfolder under the assets folder. However, when I copied the application to my test server, JQuery files were missing in the folder yii looked for them. I kept getting errors such as '../assets/db0e5a94/jquery.ba-bbq.js' 404 not found, etc.
I emptied the assets folder, and now all my CSS files etc. are reported missing. Is there any way I can cause Yii to republish to the assets folder?
Thanks!
Simply delete all sub-directories in the assets folder and clear your browser cache. Do not delete the assets directory or you will have to set the write permissions again.
in components/Controller.php add the following function:
protected function beforeAction($action){
if(defined('YII_DEBUG') && YII_DEBUG){
Yii::app()->assetManager->forceCopy = true;
}
return parent::beforeAction($action);
}
A simple way to have your assets back is to manually copy them from framework directory back. I know it is not the best way to do it, but it should help you while you find a better solution.
Ask your hosting service provider to disable SAFE_MODE in php.ini. Then remove asstes directory together with its sub files and folders and create it again. Make sure that you set CHMOD to 0777 for the new directory you just created.
I also had this same problem. After uploading the respective files to the server i changed the file permission to 755 in the server. Then it worked.
What's the best way to create a folder for my application in application data (All Users/AppData or ProgramData depending on OS) during setup?
<Directory Id="CommonAppDataFolder" Name="CommonAppData">
<!-- your subdir structure here -->
</Directory>
Use the CommonAppDataFolder property get a reference to the currect directory ( OS specific ) and then nest Directory elements along with a Component element and CreateFolder element to get the directory built out.
Also be aware of the default folder permissions of this part of the filesystem and compare it against your expectations.