Link DB to Wordpress?

Hey everyone, first time ever running anything linux or apache based ever. I ran the wordpress stackscript and got everything install. For whatever reason though, I can not seem to upload any of my themes // images from my computer to the site. I believe this is because my database is not pointing to the website? I could be completely wrong but my website bwsurfshop.com also does not work unless the url is bwsurfshop.com/wordpress/. How can I get it to simply load to www.breakwatersurf.com

Thanks for the help!

12 Replies

Tantrik,

You have a few issues.

Your database seems to be fine. You probably don't have the proper permissions set for the uploads folder to be able to upload content. You need to be careful about your directory permissions or you will be the victim of hackers and malicious code. Read this link for an overview of Wordpress file permissions: http://codex.wordpress.org/ChangingFilePermissions

If you still have upload issues you may have your installation's permissions set to only allow the admin to upload content.

To get your domain to work without the 'www' you should add an entry to your DNS. If your DNS is still managed by GoDaddy you'd want an A Record with a Host of '@' (without quotes) that points to your IP address. If you're using the Linode DNS manager an empty host field is the equivalent of GoDaddy's '@' entry.

To get your domain to automatically redirect to bwsurfshop.com/wordpress you should add the following code to your root directory's .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)? bwsurfshop.com$
RewriteRule ^(/)?$ wordpress [L]

Or you could use a simple index.html file in your root directory that redirects to the /wordpress directory. Save the following content in a file named 'index.html' (without quotes) in the root directory of your site:

<title>Breakwater Surf Shop</title>

thanks for the response. I will read up on permission rights and see if that seems to be the problem. As for getting that/wordpress out of the link. Are you saying that I MUST use a redirect line of code to make that happen? Isn't linking of the sorts shamed upon in web dev? Also another question, to make things easier, why would one not simply set everything to only allow admins to write.. Nobody else is ever going to touch anything on my server. I will always be the only admin. Would it be possible to just set my entire linode to the highest file permissions so nobody but myself will be able to do anything? I understand the file permissions, just do not understand why you need to have different privileges when an admin is reading and writing everything.

EDIT :: My apologies, I am looking to remove the /wordpress ending on my url. I have multiple domains which I will have godaddy redirect to the linode server.

Tantrik,

To get rid of your /wordpress directory - in other words having your wordpress installation at the root level of your site - read this link:

http://codex.wordpress.org/Moving_WordPress

Many websites aren't just wordpress sites. They have many other pages/sections than just the wordpress installation. Some just have a landing page that links to the wordpress installation. Others redirect to a wordpress directory. I simply offered two separate solutions to your problem. Now that I understand that you don't intend to have any other content on your domain besides the wordpress installation then moving it from /wordpress to / makes sense and will not require a redirect. The link above should help you with that.

As far as other sites having non-admins uploading content, not every website is run and maintained by just one person. Some sites have many people who contribute content. Some even have "guests" who can upload content. Wordpress provides this flexibility.

File permissions aren't as simple as "only let me do this" (though wordpress permissions are much closer to that model). In order for your wordpress code - which is public facing code - to upload to your site you have to allow for it to be written to by the correct Linux users. The file permissions link I included in the previous post should be helpful in explaining the differences.

Thanks for all your help, I have been changing around file permissions between wordpress and can not seem to get anything to budge. I believe I am changing permissions in the wrong places within wordpress. Is there any helpful way to see or understand the hierarchy in which folders and files are installed on the server? I have no idea how the files in my server are set up, what the actual folder names are, etc. Is there any way to get an entire rundown of folders in your server? As of now im literally guessing at directories to change.

There is a basic Wordpress folder hierarchy diagram in the files permissions link (http://codex.wordpress.org/ChangingFilePermissions) just above 'Shared Hosting with suexec'.

When you say "I have been changing around file permissions between wordpress", do you mean you're changing permissions from within Wordpress, or are changing the permissions of Wordpress directories (via Linux command line or an another utility such as an FTP application)?

Your issues seem to be Wordpress specific so may have better luck getting help from the Wordpress forums: http://wordpress.org/support

Problem half solved! Much easier for myself to understand where folders are being moved when I can see it being done, just connect up to filezilla which is EXTREMELY helpful. Now to explore which folder im actually suppose to change permissions on through ssh! Im getting there haha thanks for the help.

Ok so I changed permissions to 777 and still can not upload my theme. Would this be something to bring up with wordpress? I feel it is a issue talking to something because I have had many wordpress sites set up on a shared hosting that all worked fine.

EDIT :: So I found out that uploadmaxfilesize is limited to 2mb which definitely will not work. I was told this can be changed in .htaccess file and also php.ini file.. What if you do not have either..

You have a php.ini file on your system (it's usually in /etc/php5/apache2 on Ubuntu, though if you're using control panel software it may have moved it). You can also google how to change your config to support local/site-specific php.ini files, though that would be a bit of a hack if you're only running one site on your Linode.

If you don't have an .htaccess file in your root dir (or wherever you've moved your Wordpress installation) you can just add one. I would assume that Wordpress adds one to its installation directory. If you're working locally on a Mac keep in mind that Mac OS X hides all files that start with a '.' (they are considered system files).

Ok so the .htaccess being hidden was definitely the problem being on a mac, thanks. But now when I am trying to install a plugin to my wordpress, I am getting the error it can't create the directory / it doesnt exist. This again sounds like permission errors, but again I am not sure. Thoughts?

EDIT :: I do not think its a permission error as I am set to 777 right now

If all of your directories - including your site's root directory - are set to '777' and it still says it can't create the directory you could just create the directory yourself and try the installer again.

What kind of responses are you getting from the Wordpress support forum on these issues?

Well I have come back to the problem where I am getting the error maximumuploadsize is too small. Everyone is saying to change that in your .htaccess or php.ini but I cant seem to find any of these files anywhere.

EDIT:: Also tried creating php.ini and adding

uploadmaxfilesize = 64M

postmaxsize = 64M

maxexecutiontime = 300

to it to try to up the allowed limit but no luck

Now people are saying to call the provider because they can change it?

Also :: Every time I try to create a new wordpress page I get the page does not exist in the server. This can only mean that it is not properly writing correct? Gah this is painful, two weeks trying to build a simple WP server now and I cant seem to get anything remotely stable.. Every time I try to build from scratch something never works how it says it should. Can anyone reccomend a step by step tuttorial to setting a wordpress up? I have followed the linode guides count-less times receiving the same and various errors. Just at a loss now..

Tantrik,

Linodes are not 'managed' VPSs so you are responsible for their care & feeding unless you purchase the Managed Linode service (https://www.linode.com/managed).

Adding an .htaccess file to your Wordpress directory is easy. Just create a file named '.htaccess' (without quotes). To get the results you were trying to achieve in the php.ini file copy & paste the code below into the .htaccess file you created.

 <ifmodule mod_php5.c="">php_value max_execution_time  300
    php_value upload_max_filesize  64M
    php_value memory_limit  64M
    php_value post_max_size  64M
    php_flag file_uploads  on</ifmodule> 

Note: if your Wordpress installation already added an .htaccess file to the directory you originally installed it in you should add the code above into the .htaccess file Wordpress created. If your installation did not create an .htaccess file then create your own.

that fixed all the upload errors thanks!! Moved all permissions back to 775.

Figured out that not having a .htaccess file caused all the issues. Also needed to allow re-writing of directories which solved the blank page and post creation issue. Thanks for the help Main Street James! Saving Lifes!

EDIT :: If anyone else is having this issue, simply add this into your .htaccess file which should be located in your wordpress/wp-admin/ directory.

# BEGIN WordPress
 <ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]</ifmodule> 
# END WordPress

THANKS AGAIN!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct