Closed metalcated closed 10 years ago
Hi metalcated,
Sure, I can help. Where are you stuck? What does your environment look like? OS and version, Apache version, PHP version, etc? As far as detailed steps are concerned, are you asking for steps for how Apache and PHP should be set up (i.e. which modules are required, etc)?
-Dave
I am stuck at the page loading. I get it working to the point where I attempt to log in and it doesn't authenticate. I also go to the registration page and the captcha does not load either. I have undone some of this setup but I made a backup and redo it again.
Ubuntu 12.10 for now. I plan to move to 12.04.3 soon for the extended support.
Apache Version : :~# apache2 -v Server version: Apache/2.2.22 (Ubuntu) Server built: Jul 12 2013 13:37:01
:~# php -version | more phpinfo() PHP Version => 5.4.6-1ubuntu1.4
Also yes what modules are needed in case I don't have certain ones enabled. Very much appreciate the help. Thanks a bunch.
Okay, it sounds like the environment is fine if you're that far along. I think you might need to set the "domain" in the app/config/session.php. I ran into the same issue while testing a fresh install. You may also need to set some values specific to your install (e.g. "base_domain", etc) in app/config/defaults.php and app/config/server.php. Also, make sure that your database credentials are correct in app/config/database.php.
Let me know if that helps.
domain: setup already and correct base_domain: setup already and correct defaults.php: these seem to be setup correctly. database.php: I used all of the defaults
I am more than happy to share a web meeting or any information that would be helpful to resolving this. Truly appreciate your help.
Also... the doc root for this site. Should it be the public/ directory? because if I don't use that as the doc root, the site comes up as a dir listing.
Thanks
I have copied my setup back and verified the above last post and am now getting this. I even dropped the database and started clean there.
Illuminate \ Encryption \ DecryptException MAC is invalid.
Thanks
Yes, the document root should be the public directory. Is your site public facing? If so, can I try to log in using the admin username and the default password? Edit the app/config/server.php and swap the environment to "development". That will log debug messages to firebug via firePHP.
The MAC is invalid would occur if the encrypted config blob located in users_config was encrypted with a different encryption key than what is set in app/config/app.php. The correct way to change the encryption key is to first change it in app/config/defaults.php (via the default_encryption_key variable) load the site, and then change it in app/config/app.php to the same value as what you just set the default_encryption_key to. Then, it should be fine.
Since you dropped the database and started clean again, the default admin users_config would be using the default key: mSvgWo%UGKDp@q#EIgY5_t3ki56wBsA!
If you have changed it since you started trying to set things up, then you would need to change it back after restoring the database to the defaults.
public yes: http://dj.soulmovementsradio.com
I never actually changed the key, but for some reason after I made some other changes the mac message came up?
Development is all setup as well.
Have you signed up for a recaptcha account and registered your site to obtain your own public and private keys? You'll need to do that and set them in app/config/recaptcha.php. I think after you do that, the recaptcha should start working.
I'm at your site right now and it's good to see the login form validation working.
Now that I've tried to login with the default admin@mpdtunes.com and password, I'm also getting the MAC is invalid error. Can you check the "key" in app/config/app.php and the "default_encryption_key" in app/config/defaults.php and confirm that they are the same? If not, then set the app/config/app.php "key" to match whatever is set for "default_encryption_key".
Ah I didn't notice the recaptcha setup. All set now. That seems working.
'key' => 'mSvgWo%UGKDp@q#EIgY5_t3ki56wBsA!', $config['default_encryption_key'] = "mSvgWo%UGKDp@q#EIgY5_t3ki56wBsA!";
The same. Should I make an attempt to change it to something else and reload the site?
Not yet. I'm wondering why that error is occurring if you have it set to the default. Have you tried to log into MySQL from a command line using the mpdtunes user and the default password since you restored the database? Are you able to select * from mpdtunes.users_configs?
Logged on successfully. ran the query and returned this -->
mysql> select * from mpdtunes.users_configs -> ; +---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | user_id | config | +---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 1 | eyJpdiI6Imd0TWplZWFwTnpzU283a3RJbzluM2tkYzZpcjdhdFVcLzBISWptTXZhUXJ3PSIsInZhbHVlIjoiNDM5dXAxbzg3eGcxSXBXWTNrb1VyTUwwb2tJbE84QU53XC9hM1pLeHVjZmRWcXJaeGxrUllYSXdZaUM3SUR6a2NiSENZSTFpWUV5VytTd1dhbEJrWFVleFhNK3ZDOXJpMnExXC95NzFsZDNaNUhJTWNoN2V0YmpcLzMrWDFoTTBSY0g3Z1hjWEdjTXo5TWoxMkpsNTJ6U3htS3dpbkFFN0NqbWN6cjNUZUFJdGNsMHNzcFZYZmpFT0hQdExIQ21PZHRxTkE1UDVVTTBGSGdOSEVSVm94VEd2eUw1ajM3NStYWEVWTXZuT1Z4MmJqa3NmUGNIMytzUkkycjNwZDI1QlZuK1dtUXNwaWdBYThaYUNySDRGWTZKT2h2OFNaM0JEa0VFYWx5YUlOXC9pc3djSzNYbVpmZnpYeCtvaXhUVCtNS0tCQjdodk5Gd2d0MkdWdUVyQVRZRWZvc0Z4WlVKbERHSE95Vml3ekNuVk1PYXpVOGVuQkJXXC9EU1N2WmM4ZlhPMHdSd1N4OWZcL2dZTzJmZEJnZ0VYZG1yaHpWSTgwbUZaZVQ3QXNhQzZUUDJEVlRRZjlEZHhWaXNralJtMWFmdjhweDVqMk5kMU9sNnNMUnNKZkVQZmZNVFE9PSIsIm1hYyI6ImMzOTJlMjI4OWY3Yjk2ZTY3NmVmNjg3MTQ2ZGY4NDBiMjU5YWQyYWY0NGVjNzhmMjQzYzc3NDQzNjVhN2ZkNTUifQ== | +---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
Hey man I need to turn in for the night, I am east coast and need to be up at 6:30 AM. I will check through here tomorrow and follow any steps you can assist with. Are you available to discuss in other places? IM chat? or email? Thanks a ton for the help up to this point.
I'm also east coast (Northern VA). You are really close to getting it working fully. I'll try to recreate that MAC is invalid error and get back to you. We can chat through Google chat if you want. My email address is dcarrith@gmail.com.
I think I found the issue with the MAC is invalid error. Try this, log in to mysql and run this query:
UPDATE mpdtunes.users_configs SET config = "eyJpdiI6IkUreFBzb2xZa2dYRkpHT2tOeUczUmRPVWR1SGRJSndjUU9STkw4Ukp1QUk9IiwidmFsdWUiOiJDWkF5Y1NFUHg3Y2hhS0lia2x2dlwvd09RTVZSRUZvSDZ2WFAza3dWT2RlM2xJKzhHQnJUaXpUaHZCSVZHSDQyWnM2OXJ4elE3TTRaRjJpelh2RStwR2FmOHhcL1Z6a2x1YWFqNlZMNFU3cjFvRURod3ZleDl1MEg4K21KVDN0WDdKNWRwWTVTRGFZdlpZM1QrMld0VG1jbjhETFhVTmdUTDFpNklERURUajVTa1VuSTdrMXVWMGZqeWpJQlQ5Y1hOYVl0ZTNJaEo1Smo4eW5vZngxdjh0c3dGM211Q1JiQUlBWnZrdlhZVXQ2ekk2Z2g4SlFHRkRyaDB1MzB1RXQ0YzBQOEdCVWQyZDdSM01ZVzJ2aDJTTk9YVkR1MjV1bVdSZnZXZTdmOFhDZEJndWxoWXhFZmw4NnlcL1ZPNGNjVHZsVEFXN25ES0NFTWdMOTV0QktUajdSbE5WWllLWUwySzJSazIwakRTbit1MkM1cndQSFBReDBSOXg0MGlKYnBHVUFhXC9LMkc2aVhUVHhielwvRU9DcjBHNE53OThlK1wvZEtjSDBOQ05KSytrZHREUWhabEVCZ1wvczRXVloybGk2QW9DKzlZSkVcL1R0bDJWZWZRNGFIYkxQQ2R3PT0iLCJtYWMiOiI5MzQxODUzODMzZmJmMjRiZjE5MzJiNmNkNzcxYzk1NGFmOTgwNmY5Yzk4ZTY0YjE2YWRiZGI2ZTUxNDcxM2E3In0=" WHERE user_id = 1;
That will set the config to an encrypted blob that was encrypted with the default mpdtunes encryption key as set in app/config/defaults.php and app/config/app.php. It looks like somehow the migration file that creates the users_configs table was inadvertently committed with an encrypted blob that was encrypted with an old key. If you run that query, it will set it to the new value that I've just corrected in the migration file for users_configs. I'll commit and push it to git tomorrow night.
To confirm this fixed my issue. Thanks man. I messaged you on gtalk/hangouts as well.
Cool. Let me know if you run into any other issues.
When I attempt to upload an mp3 it does not show up in the uploads directory. I have the correct permissions set. Is there something else I need? certain codecs or anything of that nature?
Have you set the uploads directory for your installation? Make sure you have set default_base_uploads_dir in app/config/defaults.php. I think by default it is set to what I use (i.e. /nfs/music/uploads/). So, that may not make sense for you if you're not using a NAS via the NFS protocol. You should also make sure that your user's Music Directory is correct for your environment. You can check that via the Administration >> Users >> Username form. Again, by default it is set to what I use (i.e. /nfs/music/master/ for the master admin). Another gotcha as far as uploading the music is concerned is that you have to make sure your ID3 tags are complete with at least the following four elements:
Artist name Album name Track title Track number
I think it also requires the fileformat element of the ID3 tag to be set so it can use it as the extension of the file when it's moved into place. Putting the site into development mode via the "environment" variable in app/config/server.php will log messages to Firebug via FirePHP which can be helpful for debugging uploading issues. You'll need Firebug and FirePHP extensions for Firefox for that to work though.
I am getting the same mac error for the payments admin via FireBug. Also getting a 200 with a blank page for users admin. See screenie.
Okay, I'll probably need to generate an encrypted blob that uses the default key like I did before. Hmmm...and a 200 with blank page for admin/users huh. The only time I have seen an issue like that is when the session times out. It looks like you aren't running SSL though, so I'll need to do some testing around that. I have SSL for the admin section and login/registration, which might be why I haven't seen that. Sorry you're running into so many issues.
Here's the query that should fix the MAC is invalid issue on the payments page:
UPDATE mpdtunes.paypal_configs SET config = "eyJpdiI6IkxWVnV1YzBrWUZNZ1RJcFwvc3lcL2hTXC9oREVvMVluVE5TR0xpMXJMU3JJN1U9IiwidmFsdWUiOiJQeWhcL1dySVRyS0xZdHgrOGlGT05RSzNVaWxVcHJiRzZwTEdzQXorREk3RlQ5MnM2bGs3QmZxN1RtcWNJZGlScm5UN016U0RqVjJSVUpkNkFJblwvZ1o4TFhzd3FZY3VMeHQycmFUYkZiczJEOHd1ckkzS0Z5bWtuUSszRCtvb1wvbHRKWHhtdDJkNnE2SjJLa0R1UTNZZ3FlZmFaZ0tkaUZPTXRscXdBWk14aG5oQmhEUE5FWHZFaHlqdFdHSTdpcDcycE0wMjcxS2wwdmhCT1BXVExTcFQ2YkpBWEZ1REVNSk1WaXo2TTBQY0tQZU1td0pXMXhEWjQ5VVMxOXpOS0NMVVJONDMzWTBxYlZGR3NZZFJWQTFZNnE2YnZuNFdNZEVjS2ZpeG1oTkxEXC9ydEdtdW5pVXBxeGtUVFJzbStRUXRFVTRHSTFtVDN0c3VROGs5XC8yWWluUm1meWo1MElmV3Q4aVRXMjBcLzVobXZndTZSYXdCUUladFA3WWI0OTRBem1SOU0wcFRBTXVRYk5mR2ZRRlhiOFpJNHBBNERQeWtmb2pxcWc1dmtsWEhCc0dxSEZsUEJ6eU9ZcEN4UzVWaXBSWEsxMlRzVmdGdFwvckdZYlJcLzJQYmdsSG16QnJoMitCa2g0K3ZGT0FsTzVaOEM4RnNIUUE5cDJxWVI3R0ZKXC8rNEJDRDcrWDFEVHlzQWRyR2dyOGxDS0YyYXBEMzZsREdta2kzb21qbVJRbmVDSlEreFB3T3JlZTBFcGF3NVZqTTJoXC9aS2RTaXFpNUl4MTl5NjNvT0ZjSVNGUm0yYkE2dlgzbDJnWE1sYlZZN3c0V3FlSmhhYXZlZWNcL3JJSnowWW54XC9yY0NMTk5nS01WSk5zbENUVzdsZzVUUG5BanRjWk9sa1VKcjBxWTZuNnBOaHRqYktXeGJ4Q0J5QmF1cFd5RWNGYW5LTVlQWjFOK0NLUUhpVkNqUmc9PSIsIm1hYyI6ImJlY2JlY2JkNjRlNzA4YjRiMTJiYTAyZjE0NzdjNjNhOGE1NDI2MzY5MWU3NjA0NmNmNTRjODNhNTMzMTNhODgifQ==" WHERE user_id = 1;
Hey no problem at all... I am all for troubleshooting and coming up with solutions. Also still not able to upload. I am very well aware of what NAS is and the technology. I work with this type of stuff daily, load balancers, dns, web hosting, etc. ;) So I did change the directory path and even went as far to chmod 766 to ensure read/write all is set for troubleshooting. I can also setup SSL on the admin section and login process. I will go get a cert and install it today. Hey at least this may help you write a more enhanced readme to ensure others don't face these issues as well as fix some bugs if they exist. Again more than happy to do troubleshooting.
Yep that query fixed the admin payment section. Awesome. Again... Thank you.
Are you protecting the entire site with SSL or just the admin section? And if just admin are you using a rewrite to force SSL?
You're welcome. By the way, I just noticed that my demo site is not actually using SSL. But, my other site is. So, really, that shouldn't be a problem. Are you still getting a blank page when going to admin/users? Try clearing your browser cache and then log back in and go straight to admin/users.
I'm glad to hear you're a power user.
Well, when I first started the project 2 years ago, there were issues with the <audio> element when the site was over SSL. So, I built in logic to only use SSL over login/registration and any admin pages. It's controlled at the application level, not Apache with mod_rewrite. I have noticed since then that the <audio> element will play music over SSL now too. So, you could do it all over SSL with mod_rewrite. But, that might cause redirect loops without some code changes.
I have to head into work, but I'll be back online tonight.
I am waiting on the cert to be generated, so I'll have that later on tonight.
As for MP3 uploads, if you want to register and I can give you admin rights... by all means we I am more than willing. Whatever steps we can take to get this working I am all for.
Thanks again.
Can you email me one of the .mp3 files you're trying to upload? I'll upload it in my environment and see what happens. I'm wondering if the id3 tag is of a different format than what I've tested. I tried to visit your site to register, but it doesn't seem to be responding at the moment.
Yeah sorry I was doing some maintenance, site is back up and running now. I will email you the mp3 in a bit.
I sent you an email with an mp3 attached. Let me know how it works out for you.
I did not receive anything. What is the size of the mp3 file?
That gives me an idea. By default, PHP sets max_upload_size to something really low...like 2M or 8M. I typically increase that to 128M. The same goes for max_post_size.
{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Failed to move uploaded file."}, "id" : "id"}
I got the above error now after making some adjustments to MPD to ensure both the web app and mpd are using the same directories. Being this is jailed environment, it can be touchy. Also I see the settings that I have already modified -->
upload_max_filesize = 256M
But now post_max_size was only 8M and I didn't even realize this because if the post size must be equal or larger than the upload size. So I did this...
post_max_size = 256M
I am testing now, I will let you know soon. Thanks
Since I am in a jailed environment, FCGI was not working due to the /tmp folder upload settings. No way that I know of around that. So I switched to Mod-PHP for now and I am able to get passed the 500 errors I was seeing with FCGI but now I get a different error.
Error in exception handler: The stream or file "/var/www/clients/client2/web13/web/app/storage/logs/log-apache2handler-2013-09-25.txt" could not be opened: failed to open stream: Permission denied in /var/www/clients/client2/web13/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:71
I get that error if I change the ownership of the files in htdocs to be owned by my user (rather than the apache user - and therefore, apache can't write to the logs in app/storage/logs).
You should be able to fix it by recursively chown'ing htdocs:
sudo chown -R apacheuser:apachegroup /path/to/htdocs
I just wanted to add that command for completeness in case other users come across this issue posting.
I did that in the very beginning and I think that I am at a place where using this in a jailed environment may not work. I am going to move this setup to a non jailed setup and see if that makes a difference.
I did actually try changing permissions from the jailed user to the actual apache user but that didn't make a difference either.
I will keep this updated with my progress. Thanks
Is it difficult for you to switch back and forth between the jailed setup and the non-jailed setup? If you were getting that failed to open stream for the log-apache2handler file, it means two things. The application was encountering an exception, and it was not able to write to the log file. If you can relax permissions enough so that it can write to the log file, you might be able to find some interesting log entries in there. Have you tried a recursive chmod 777 for the entire htdocs just to see if you can get it to load and log to that file? Really though, you should only have to chmod 777 that app/storage/logs directory.
Also, keep in mind that if you are switching back and forth between jailed and non-jailed setups but using the same htdocs directory, you still might want to do an ls -l on the app/storage/logs directory to see if Apache has created a new log file for a new day because it would be owned by Apache and it would have permissions based on whatever umask setting you have. So, it would be necessary to adjust ownership/permissions to match whatever your jailed or non-jailed setup is supposed to have.
using the jailed setup pointing to a dirctory in the jailed environment: /private/mpd/music
fopen(/private/mpd/music/uploads/o_185db5qdg1sikqg21phj1kv5j7ld.mp3): failed to open stream: No such file or directory
in the jailed environment pointing to the full path: /var/www/clients/client2/web13/private/mpd/music
<p class="exc-message">
file_exists(): open_basedir restriction in effect. File(/var/www/clients/client2/web13/private/mpd/music/uploads/o_185dbe3ul1eknjh4cjj16rkdfld.mp3) is not within the allowed path(s): (/var/www/clients/client2/web13/web:/var/www/clients/client2/web13/tmp:/var/www/dj.soulmovementsradio.com/web:/srv/www/dj.soulmovementsradio.com/web:/usr/share/php5:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin)
</p>
Both tested changes are done in app/config/defaults.php
Should changes also be made in mpd.conf?
I can set this up on another server and dedicate the setup to this web app. but I did want to hand over the control to someone else once this is completed. However when I use the setup from the jailed environment and change the permissions accordingly... I receive a 404 on the /login. I am going to set this up from scratch on the new dedicated server. Hope it goes easier ;)
I would like to get both working so I can choose which to use. Appreciate all of your help on this, much thanks.
I think if you want fopen to work with a relative path, you'll need to use "private/mpd/music" not "/private/mpd/music".
I haven't attempted to run this in a jailed environment, so unfortunately, you're in uncharted territory. If you want to send me more details on your jailed setup, I can try to recreate that "open_basedir restriction in effect" error this weekend to see if I can better assist fixing it.
As far as mpd.conf, the answer is yes, for now, you would need to update any paths that you're changing around in there to enable MPD to function properly. I have been meaning to add the code to re-write the mpd.conf after changes are made in admin/users/username form. I just haven't implemented that yet. Until you can upload successfully, the mpd.conf won't come into play though. That is, unless you manually upload the music files as a test to make sure everything else besides the uploading is working properly. In that case, you'll need to make sure the paths in mpd.conf are correct.
I changed the path as suggested and still getting the same error without the "/" slash. I have no problem giving you access to the environment and taking a look on your own or if you prefer I can setup a site all your own in the jailed environment to play around and troubleshoot. We can do both or either. Let me know and send me a message on Hangouts or in email. (You can get my email from Hangouts).
I did however setup a second site on a dedicated Apache instance: http://dj.glassnetworks.net And I am getting a 404 when routed to /login. I followed the steps and any of the additional items from above that may have come into play.
As always lol, thanks man. Much appreciated.
Okay, the 404 is caused by an assumption in the code that there will be clean URLs. So, if you go directly to http://dj.glassnetworks.net/index.php/login it will load. So, if you set up clean urls for that domain too, then it will work. I think you've identified another bug. I should probably be using Laravel's built in functions for getting the site url for redirects so that the index.php would be included if clean urls aren't set up.
Check the example conf file for an example of how to get clean urls working:
https://github.com/dcarrith/mpdtunes/blob/master/examples/yourdomain.com.conf
Specifically, it's this rule:
RewriteCond %{REQUEST_FILENAME} !^(index\.php|/images|/includes|/cache|/mpd|/queues|/samples|/robots\.txt|/sitemap\.xml)
RewriteRule ^(.*)$ /index.php/$1 [L]
The site loads but the login does not work. Invalid password, but I did not change the password. I also used one of the examples but am receiving a 500 internal server error when I do. I go back to the default and add the conditions above but same thing happens.
Sorry to keep you busy lol. but thanks again for the help. Again if you wanted to discuss more easily, I am on hangouts.
Copied the mp3 manually into the path that is configured and once completed, changed permissions and refreshed the MPD Database. Went to Artists and clicked on the band's name... got this -->
{"error":{"type":"ErrorException","message":"Undefined variable: art_file","file":"\/var\/www\/clients\/client2\/web13\/web\/public\/includes\/php\/library\/art.inc.php","line":239}}
I have definitely seen that before, but I thought I fixed it. Try adding the following line to public/includes/php/library/art.inc.php around line 34 or so:
$art_file = $art_dir.$filename.'.jpeg';
That should be right after this line:
$filename = sha1($artist . " - " . $album);
This is right after that line:
// check for an existing album art cache file based on a default value and type
$album_art_file_exists = file_exists($document_root.$art_dir.$filename.".jpeg");
That worked getting past that screen. Once the Artist list shows up, the album art is blank (image does not load).
Next I created a playlist and then went to look at the playlist... got this error:
{"error":{"type":"ErrorException","message":"Undefined offset: 1","file":"\/var\/www\/clients\/client2\/web13\/web\/app\/controllers\/PlaylistTracksController.php","line":119}}
Hey I am trying like hell to get this working all weekend. I am a seasoned Web hosting admin and even then still having trouble with getting this working. Do you have a more detailed step by step for how these files are supposed to hosted and also what the dependencies are? I tried to run this in a jailed hosting environment and when that didn't work, I then set it up under a dedicated apache setup and still... not working. Appreciate any help. I will donate for sure once this is working, 100% on that.
Thanks metal