Archive for the ‘APM&WP’ Category
WordPress升级到2.5.1
人家说2.5不好,而且2.5.1刚出来,是针对2.5的缺点进行了修改,所以就更新到2.5.1,而且用的是英文版的。我也不知道那里不好,跟风吧!
用2.3的时候,界面是有点不好看,但是看习惯了,到2.5的时候操作实在是不顺手。不过用户体验是慢慢改过来的,就这样,适应了。2.5.1的管理界面配色和2.5的是一样的,这种配色对我来说感觉非常的Nice,哈哈。清淡。
我看2.5.1和2.5没什么区别,有人说的程序优化,可惜我是学语文的,现在没那种激情和心情研究了。能用就行。
WordPress升级到2.5,出了点小差错
在CNBETA上看到WordPress 2.5 中文正式版。一不做二不休。删除旧文件,上传新文件,升级一路狂飙。没出任何差错。
以前的主题还可以用,直接上传就搞定了。郁闷的是一个插件有问题。我只用了四个插件
1.Akismet
2.Google XML Sitemaps
3.SRG Clean Archives
4.WordPress Database Backup
Read the rest of this entry »
php套件到底用哪个好?
因为部署正式站点,drupal在iis下面走不好,所以用apache。出于懒惰的心理,想用php套件,还省得自己修改mysql配置,php配置,apache配置。当然,我说的不是pianorock,这就用的最繁琐的一个个安装的方式弄起来的。
尝试过如下套件,xampp,easyphp,phpnow,twapms,discuz的exp系统。 包括在discuz官方,也说了exp可以用来部署正式站点了。自然是在php和apache的配置上安全做的比较好。唯一的麻烦是,它的数据库端口默认是在6033而不是3306,然后我已经有了许多站点,在那么多站点的配置文件里一个个修改3306为6033很头疼。因为许多地方的特征码我也输入的3306,一次性替换又可能出错。就暂时放弃了。但作为部属正式站点,这是个值得推荐的选择。相关组件版本也很新。
Read the rest of this entry »
Wordpress显示文章摘要,修改摘要输出”Read the rest of this entry”
有些时候,某篇文章比较长时,或者图片较多,那样会导致首页的加载速度变慢,这时就要用到文章的截断功能 <!–more–> 。这样可以使首页只显示文章的 <!–more–> 之前的内容,不过默认的显示字样一般是“Read the rest of this entry…”,这时我们可以修改这段内容,让其显示为中文,例如:”展开阅读…”。
这时你需要修改index.php,找到 <?php the_content(’ Read the rest of this entry »’); ?>, 把红色的内容替换成你想要的内容就行了~
Read the rest of this entry »
.htaccess指南
.htaccess指南
|
这是关于.htaccess的一篇介绍,也是很容易让人理解的一篇关于.htaccess应用的文档,我随意翻译了一下,自己也玩一玩.htaccess • Part 1 – Introduction介绍 Part 1 – Introduction介绍 Introduction 介绍 In this tutorial you will find out about the .htaccess file and the power it has to improve your website. Although .htaccess is only a file, it can change settings on the servers and allow you to do many different things, the most popular being able to have your own custom 404 error pages. .htaccess isn’t difficult to use and is really just made up of a few simple instructions in a text file. Will My Host Support It? 我的主机支持它吗? This is probably the hardest question to give a simple answer to. Many hosts support .htaccess but don’t actually publicise it and many other hosts have the capability but do not allow their users to have a .htaccess file. As a general rule, if your server runs Unix or Linux, or any version of the Apache web server it will support .htaccess, although your host may not allow you to use it. A good sign of whether your host allows .htaccess files is if they support password protection of folders. To do this they will need to offer .htaccess (although in a few cases they will offer password protection but not let you use .htaccess). The best thing to do if you are unsure is to either upload your own .htaccess file and see if it works or e-mail your web host and ask them. What Can I Do? 我该怎么做? You may be wondering what .htaccess can do, or you may have read about some of its uses but don’t realise how many things you can actually do with it. There is a huge range of things .htaccess can do including: password protecting folders, redirecting users automatically, custom error pages, changing your file extensions, banning users with certian IP addresses, only allowing users with certain IP addresses, stopping directory listings and using a different file as the index file. Creating A .htaccess File 创建一个.htaccess文档 Creating a .htaccess file may cause you a few problems. Writing the file is easy, you just need enter the appropriate code into a text editor (like notepad). You may run into problems with saving the file. Because .htaccess is a strange file name (the file actually has no name but a 8 letter file extension) it may not be accepted on certain systems (e.g. Windows 3.1). With most operating systems, though, all you need to do is to save the file by entering the name as:
(including the quotes). If this doesn’t work, you will need to name it something else (e.g. htaccess.txt) and then upload it to the server. Once you have uploaded the file you can then rename it using an FTP program. Warning 警告 Before beginning using .htaccess, I should give you one warning. Although using .htaccess on your server is extremely unlikely to cause you any problems (if something is wrong it simply won’t work), you should be wary if you are using the Microsoft FrontPage Extensions. The FrontPage extensions use the .htaccess file so you should not really edit it to add your own information. If you do want to (this is not recommended, but possible) you should download the .htaccess file from your server first (if it exists) and then add your code to the beginning. Custom Error Pages 自定义错误页 The first use of the .htaccess file which I will cover is custom error pages. These will allow you to have your own, personal error pages (for example when a file is not found) instead of using your host’s error pages or having no page. This will make your site seem much more professional in the unlikely event of an error. It will also allow you to create scripts to notify you if there is an error (for example I use a PHP script on Free Webmaster Help to automatically e-mail me when a page is not found). You can use custom error pages for any error as long as you know its number (like 404 for page not found) by adding the following to your .htaccess file:
For example if I had the file notfound.html in the root direct
If the file is not in the root directory of your site, you just need to put the path to it:
These are some of the most common errors:
Then, all you need to do is to create a file to display when the error happens and upload it and the .htaccess file. Introduction 介绍 In the last part I introduced you to .htaccess and some of its useful features. In this part I will show you how to use the .htaccess file to implement some of these. Stop A Directory Index From Being Shown 停示显示目录索引 Sometimes, for one reason or another, you will have no index file in your directory. This will, of course, mean that if someone types the directory name into their browser, a full listing of all the files in that directory will be shown. This could be a security risk for your site. To prevent against this (without creating lots of new ‘index’ files, you can enter a command into your .htaccess file to stop the directory list from being shown:
Deny/Allow Certian IP Addresses 阻止/允许特定的IP地址 In some situations, you may want to only allow people with specific IP addresses to access your site (for example, only allowing people using a particular ISP to get into a certian directory) or you may want to ban certian IP addresses (for example, keeping disruptive memembers out of your message boards). Of course, this will only work if you know the IP addresses you want to ban and, as most people on the internet now have a dynamic IP address, so this is not always the best way to limit usage. You can block an IP address by using:
where 000.000.000.000 is the IP address. If you only specify 1 or 2 of the groups of numbers, you will block a whole range. You can allow an IP address by using:
where 000.000.000.000 is the IP address. If you only specify 1 or 2 of the groups of numbers, you will allow a whole range. If you want to deny everyone from accessing a directory, you can use:
but this will still allow scripts to use the files in the directory. Alternative Index Files 替代的index文档 You may not always want to use index.htm or index.html as your index file for a directory, for example if you are using PHP files in your site, you may want index.php to be the index file for a directory. You are not limited to ‘index’ files though. Using .htaccess you can set foofoo.blah to be your index file if you want to! Alternate index files are entered in a list. The server will work from left to right, checking to see if each file exists, if none of them exisit it will display a directory listing (unless, of course, you have turned this off).
Redirection 重新指向 One of the most useful functions of the .htaccess file is to redirect requests to different files, either on the same server, or on a completely different web site. It can be extremely useful if you change the name of one of your files but allow users to still find it. Another use (which I find very useful) is to redirect to a longer URL, for example in my newsletters I can use a very short URL for my affiliate links. The following can be done to redirect a specific file:
In this above example, a file in the root directory called oldfile.html would be entered as:
and a file in the old subdirectory would be entered as:
You can also redirect whole directoires of your site using the .htaccess file, for example if you had a directory called olddirectory on your site and you had set up the same files on a new site at: http://www.newsite.com/newdirectory/ you could redirect all the files in that directory without having to specify each one:
Then, any request to your site below /olddirectory will bee redirected to the new site, with the
They would be redirected to:
This can prove to be extremely powerful if used correctly. Part 3 – 密码保护 Introduction 介绍 Although there are many uses of the .htaccess file, by far the most popular, and probably most useful, is being able to relaibly password protect directories on websites. Although JavaScript etc. can also be used to do this, only .htaccess has total security (as someone must know the password to get into the directory, there are no ‘back doors’) The .htaccess File Adding password protection to a directory using .htaccess takes two stages. The first part is to add the appropriate lines to your .htaccess file in the directory you would like to protect. Everything below this directory will be password protected:
There are a few parts of this which you will need to change for your site. You should replace “Section Name” with the name of the part of the site you are protecting e.g. “Members Area”. The /full/parth/to/.htpasswd should be changed to reflect the full server path to the .htpasswd file (more on this later). If you do not know what the full path to your webspace is, contact your system administrator for details. The .htpasswd File Password protecting a directory takes a little more work than any of the other .htaccess functions because you must also create a file to contain the usernames and passwords which are allowed to access the site. These should be placed in a file which (by default) should be called .htpasswd. Like the .htaccess file, this is a file with no name and an 8 letter extension. This can be placed anywhere within you website (as the passwords are encrypted) but it is advisable to store it outside the web root so that it is impossible to access it from the web. Entering Usernames And Passwords 输入用户名和密码 Once you have created your .htpasswd file (you can do this in a standard text editor) you must enter the usernames and passwords to access the site. They should be entered as follows:
where the password is the encrypted format of the password. To encrypt the password you will either need to use one of the premade scripts available on the web or write your own. There is a good username/password service at the KxS site which will allow you to enter the user name and password and will output it in the correct format. For multiple users, just add extra lines to your .htpasswd file in the same format as the first. There are even scripts available for free which will manage the .htpasswd file and will allow automatic adding/removing of users etc. Accessing The Site 访问网站 When you try to access a site which has been protected by .htaccess your browser will pop up a standard username/password dialog box. If you don’t like this, there are certain scripts available which allow you to embed a username/password box in a website to do the authentication. You can also send the username and password (unencrypted) in the URL as follows:
Summary 小结 .htaccess is one of the most useful files a webmaster can use. There are a wide variety of different uses for it which can save time and increase security on your website. |
