I am following the music application article on Yarivs blog. When I go to http://localhost:8002 I get the index page showing correctlty but if I try to browse to http://localhost:8002/music I get this error(see Pastie), When I browse http://localhost:8002/musician i get page not found, even though I have created the musician component. I am getting the same thing happening with all the erlyweb applications I have tried. Any ideas on where I could be going wrong.
This is my server section of the yaws config.
<server localhost>
port = 8002
listen = 0.0.0.0
docroot = "C:/Program Files/Yaws-1.84/applications/music/www"
appmods = <"/music", erlyweb>
<opaque>
appname = music
</opaque>
</server>
That error looks like the erlyweb:out function is not in the code:path.
Possible causes?
ErlyWeb is not in the codepath that yaws is using.
erlyweb is not compiled so even though the source code is in the path the .beam files aren't so yaws can't load the module.
Short of looking at your system I'm afraid that's all I can tell you.
OK I have fixed it. I added the following two lines to my yaws.config file
ebin_dir = "C:\Program Files\erl5.7.2/lib/erlyweb-0.7.1/ebin"
ebin_dir = "C:/Program Files/Yaws-1.84/applications/music/ebin"
The first one picks up erlyweb and the second the ebin directory for my application.
Related
I have a big problem concerning the file upload limit (I need a large size, around 2Go) : I was using my app in /var/www/vhost/default and it was working perfectly, I decided to change it and use /var/www/vhost/mydomain.com to have it throught the plesk panel, and there I have an upload limit than I need to push. I can't upload files larger than 128Mo and I don't know why.
I have checked all php.ini files (with locate php.ini) and they are all correct.
I used plesk panel to set php conf -> done.
I put :
php_value memory_limit 2000M
php_value upload_max_filesize 2000M
php_value post_max_size 2000M
in my .htaccess in htdocs
I put a vhost.conf and a vhost_ssl.conf in /var/www/vhost/mydomain.com/conf with :
< Directory /var/www/vhosts/mydomain.com/htdocs/>
php_value upload_max_filesize 2000M
php_value post_max_size 2000M
php_value memory_limit 2000M
< / Directory>
I disabled nginx.
I edited /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php to put :
FcgidMaxRequestLen 2147483648
I tried :
grep attach_size_limit /etc/psa-webmail/horde/imp/conf.php
$conf['compose']['link_attach_size_limit'] = 0;
$conf['compose']['attach_size_limit'] = 0;
I reload/restart apache2, psa, ... And it still doesn't work, I have no more idea every conf file seems correct. It's not a permission problem because I can upload some 80Mo files but not 500Mo ...
Someone has an idea ?? I need to fix it fast
Thanx !!
So, to begin with, I'm now in charge of the problem explained above.
That said, it is solved.
I'll explain the steps there if someone ever encounters something similar, so this topic might help.
Three problems here, in fact :
First, nginx overridden by plesk default templates. So you need to create (if it doesn't exist) a "custom" folder in "/usr/local/psa/admin/conf/templates", then copy and paste choosen files (here: /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php) in the custom folder (keep the hierarchy of the folders when copying the files). Modify your files as you want (client_max_body_size here), check that your files are valid php using "php -l nginxDomainVirtualHost.php", and generate new files using this command : "/usr/local/psa/admin/bin/httpdmng --reconfigure-all" (you might use another --reconfigure option). That's it. Source: link
Second: Copy and paste "/usr/local/psa/admin/conf/default/domain/domainVirtualHost.php" into the custom folder mentioned above, edit the line where FcgidMaxRequestLen is to your own value. Save and check that your php file is valid. Generate new configuration files. Source: link
Third: there is a php menu named "PHP settings" under "Website and domains" on Plesk, there you can override config files by applying custom value directly for memory_limit, post_max_size, and upload_max_filesize. Of course, php.ini files were changed accordingly prior to that (cf. OP's post).
That was the last thing that keeped us from uploading bigger files.
Can you please try to check your php upload limit by creating phpinfo file under account. If it's showing correct value and your application is not working then try to update your /etc/httpd/conf.d/fcgid.conf file.
I have some issue with changing CHMODs via FTP by ruby.
Sample of code:
ftp = Net::FTP.new('ftp.example.com')
ftp.login(ENV['FTP_USER'], ENV['FTP_PASS'])
ftp.chdir('/import')
ftp.mkdir(file_name)
ftp.chdir(file_name)
ftp.put(File.open(xml_file))
ftp.put(File.open(csv_file))
ftp.quit
I create a new directory and I upload two files into it. I must change CHMODs of new dir and files becouse other user can't remove it. I found something like that:
ftp.sendcmd("SITE CHMOD 777 filename")
but return this:
Net::FTPPermError: 502 SITE: Command not implemented.
Maybe someone knows how do that it?
I have written a fuse mirror file system using FUSE-JNA, Which mirror local directory.
This Mirror file system allow me to open all types of files correctly with no issue but it does not open all types of office files e.g. .docs , .xls etc. And give me be below error while opening any office file.
Note:
I thought its LibreOffice issue, so I removed it and installed OpenOffice. But get the same issue.
Secondly, the errors only pops up when I try to access an office file from my MirrorFileSystem. Office files opens correctly if accessed normally via ubuntu default file system.
So its some thing wrong with my File system.
Finally, (i don't know whether its related to the question or not but) in my mirror file system when I Right Click on a file>Properties> Permission its shows all the fields disabled, as below
This is my getatt() method:
public int getattr(final String path, final StatWrapper stat)
{
....
if (f.isFile())
{
stat.setMode(NodeType.FILE,true,true,true,true,true,true,true,true,true);
stat.size(f.length());
stat.atime(f.lastModified()/ 1000L);
stat.mtime(0);
stat.nlink(1);
stat.uid(0);
stat.gid(0);
stat.blocks((int) ((f.length() + 511L) / 512L));
return 0;
}
...
}
Please guide me how to fix general input/output error while office files?
Office files are not special. There is some other problem with your filesystem implementation, and you need to do more debugging work to find out precisely what the trigger and the cause is. It's very unlikely that the trigger truly is "the file is an office file", unless you have stuff in your filesystem code that operates differently based on the type of file it's dealing with (in which case you should look there). As a first debugging step, you could compare the sha1sum and stat output of the files from the fuse filesystem and from the root filesystem to see if they match. If they don't, adjust the filesystem code such that they do. You could also enable logging on your filesystem class and check if it's returning an I/O error code anywhere. The error message "general input/output error" makes it sound like that is the case.
As for the reason the permissions fields are disabled, that's because the file is owned by root, and you are not root so you can't change the permissions. The reason the file is owned by root is because you set stat.uid(0); and stat.gid(0); in getattr. UID 0 and GID 0 are for the root user and root group respectively. Fuse-JNA already puts the current UID and GID as default stat attributes in getattr, so if you want to use these then just don't call stat.uid(0); or stat.gid(0);.
Thanks for the answer.
I searched on web, on many websites they showed file locking as the reason e.g. https://forum.openoffice.org/en/forum/viewtopic.php?f=10&t=2020 etc
So in fuse, I implemented file lock function and simply return 0
My problem solved. Now I can open all types of office files.
But I do not know, is it perfect solution
I recently had to start making small changes to an existing site so I downloaded it and tried to run it but get an error:
Call to undefined method sfContext::getController() in
/home/user/www/site.com/web/index.php on line 16
I tried to figure out which file is being loaded by inserting these lines with this command in index.php right before the dispatch call.
$reflection = new ReflectionClass('sfContext');
$classFile = $reflection->getFileName();
die($classFile);
sfContext::getInstance()->getController()->dispatch();
And it looks like file loaded is:
/home/user/www/site.com/lib/vendor/symfony1.0/test/unit/sfContextMock.class.php
This symfony1.0 site works fine on original server but not on my local machine.
I checked php version and php.ini and they are identical. I cant figure out why wrong class is being loaded or what the problem is.
Here is the index.php file
<?php
define('SF_ROOT_DIR', realpath(dirname(__FILE__).'/..'));
define('SF_APP', 'front');
define('SF_ENVIRONMENT', 'prod');
define('SF_DEBUG', true);
require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
sfContext::getInstance()->getController()->dispatch();
You should update to the lastest one available (1.0.22).
I'm following the example here: http://code.google.com/p/modwsgi/wiki/IntegrationWithPylons
however, it doesn't work - I get "ImportError: No module named paste.deploy" in the apache error log. Googling in this case helps not - I see some stuff about permissions, but all my permissions are fine. Where does paste.deploy really come from? It comes from PasteDeploy-1.3.4-py2.6.egg in site-packages, installed in my pylonsdevenv directory, right? Well, then how is apache supposed to know about that directory? Does the actual pylons project have to be in the pylonsdevenv directory?
thanks!
I added:
import site
site.addsitedir('/<yadayada>/pylonsdevenv/lib/python2.6/site-packages')
to the top of my wsgi file, and then set debug = False in my development.ini file (and later, deployment.ini file, I presume), that seemed to work...
If you can import (from paste.deploy import loadapp) manually it has to be a problem with sys.path. Also make sure that apache uses proper python interpreter. I have something like this in my "passanger_wsgi.py" on Dreamhost:
INTERP = "/home/myuser/bin/python"
if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)
cwd = os.getcwd()
sys.path.append(os.getcwd())
sys.path.append('/home/myuser/blog')
You can try put some debug and check which paths are inside "sys.path".
Hope this helps.