그림과 같이 스크롤이 움직여도 오른쪽 하단에 고정! (이 티스토리에도 적용)


간단하게 <div>로 id를 주고 <div id="value"> code </div>

css를 통해 적용시킨다. 코드

 

##HTML

    <div id="jasontody"><h3>Jasontody</h3></div>

##CSS

#jasontody { position: fixed; right: 0%; /* 위치 */ bottom: 0%; opacity: 0.5; /* 투명도 */ }





test1



ftp사용해서 웹에서 설치할때, 폴더 권한을

777로 줘야하는듯.

707안됨

sudo chmod 777 -R xe


Setup


The steps in this tutorial require the user to have root privileges. You can see how to set that up in the Initial Server Setup in steps 3 and 4. 

Before working with wordpress, you need to have LEMP installed on your virtual private server. If you don't have the Linux, nginx, MySQL, PHP stack on your VPS, you can find the tutorial for setting it in the LAMP tutorial

Once you have the user and required software, you can start installing wordpress!

Step One—Download WordPress


We can download Wordpress straight from their website:
wget http://wordpress.org/latest.tar.gz

This command will download the zipped wordpress package straight to your user's home directory. You can unzip it the the next line:
tar -xzvf latest.tar.gz 

Step Two—Create the WordPress Database and User


After we unzip the wordpress files, they will be in a directory called wordpress in the home directory on the virtual private server. 

Now we need to switch gears for a moment and create a new MySQL directory for wordpress. 

Go ahead and log into the MySQL Shell:
mysql -u root -p

Login using your MySQL root password, and then we need to create a wordpress database, a user in that database, and give that user a new password. Keep in mind that all MySQL commands must end with semi-colon. 

First, let's make the database (I'm calling mine wordpress for simplicity's sake; feel free to give it whatever name you choose):
CREATE DATABASE wordpress;
Query OK, 1 row affected (0.00 sec)

Then we need to create the new user. You can replace the database, name, and password, with whatever you prefer:
CREATE USER wordpressuser@localhost;
Query OK, 0 rows affected (0.00 sec)

Set the password for your new user:
SET PASSWORD FOR wordpressuser@localhost= PASSWORD("password");
Query OK, 0 rows affected (0.00 sec)

Finish up by granting all privileges to the new user. Without this command, the wordpress installer will not be able to start up:
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

Then refresh MySQL:
FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

Exit out of the MySQL shell:
exit

Step Three—Setup the WordPress Configuration


The first step to is to copy the sample WordPress configuration file, located in the WordPress directory, into a new file which we will edit, creating a new usable WordPress config:
cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php

Then open the wordpress config:
sudo nano ~/wordpress/wp-config.php

Find the section that contains the field below and substitute in the correct name for your database, username, and password:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'wordpressuser');

/** MySQL database password */
define('DB_PASSWORD', 'password');
Save and Exit.

Step Four—Copy the Files


We are almost done uploading Wordpress to the server. We need to create the directory where we will keep the wordpress files:
sudo mkdir -p /var/www

We can modify the permissions of /var/www to allow future automatic updating of Wordpress plugins and file editing with SFTP. If these steps aren't taken, you may get a "To perform the requested action, connection information is required" error message when attempting either task. 

The first command changes the ownership of /var/www to www-data, the ubuntu web user and group. The subsequent two add a user to the group, and allow the group to read and write to any file in the directory.
sudo chown -R www-data:www-data /var/www
sudo usermod -a -G www-data username
sudo chmod -R g+rw /var/www

The final move that remains is to transfer the unzipped WordPress files to the website's root directory.
sudo cp -r ~/wordpress/* /var/www

Step Five—Set Up Nginx Server Blocks


Now we need to set up the WordPress virtual host. Create a new file for the for WordPress host, copying the format from the default configuration:
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/wordpress

Open the WordPress virtual host:
sudo nano /etc/nginx/sites-available/wordpress

The configuration should include the changes below (the details of the changes are under the config information):
[...]
server {
        listen   80; ## listen for ipv4; this line is default and implied
        #listen   [::]:80 default ipv6only=on; ## listen for ipv6

        root /var/www;
        index index.php index.html index.htm;

        # Make site accessible from http://localhost/
        server_name example.com;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to index.html
                try_files $uri $uri/ /index.php?q=$uri&$args;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
        }

        location /doc/ {
                alias /usr/share/doc/;
                autoindex on;
                allow 127.0.0.1;
                deny all;
        }

        # Only for nginx-naxsi : process denied requests
        #location /RequestDenied {
                # For example, return an error code
                #return 418;
        #}

        #error_page 404 /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
               root /usr/share/nginx/www;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

                # With php5-cgi alone:
                fastcgi_pass 127.0.0.1:9000;
                # With php5-fpm:
        #       fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /\.ht {
               deny all;
        }
}
[…]
Here are the details of the changes:

  • Change the root to /var/www/

  • Add index.php to the index line.

  • Change the server_name from local host to your domain name or IP address (replace the example.com in the configuration)

  • Change the "try_files $uri $uri/ /index.html;" line to "try_files $uri $uri/ /index.php?q=$uri&$args;" to enable Wordpress Permalinks with nginx

  • Uncomment the correct lines in “location ~ \.php$ {“ section

Save and Exit that file.

Step Six—Activate the Server Block

Although all the configuration for worpress has been completed, we still need to activate the server block by creating a symbolic link:
sudo ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/wordpress

Additionally, delete the default nginx server block.
sudo rm /etc/nginx/sites-enabled/default

Then, as always, restart nginx:
sudo service nginx restart

Step Seven—RESULTS: Access the WordPress Installation


Once that is all done, the wordpress online installation page is up and waiting for you: 

Access the page by visiting your site's domain or IP address (eg. example.com) and fill out the short online form (it should look like this).







Step One—Update Apt-Get


Throughout this tutorial we will be using apt-get as an installer for all the server programs. On May 8th, 2012, a serious php vulnerability was discovered, and it is important that we download all of the latest patched software to protect the virtual private server. 

Let's do a thorough update.
sudo apt-get update
sudo apt-get -u upgrade

Step Two—Install MySQL


Once everything is fresh and up to date, we can start to install the server software, beginning with MySQL and dependancies.
sudo apt-get install mysql-server mysql-client php5-mysql

During the installation, MySQL will ask you to set a root password. If you miss the chance to set the password while the program is installing, you can easily create it later within the MySQL shell. 

Step Three—Install nginx


Once MySQL is all set up, we can move on to installing nginx on the VPS.
sudo apt-get install nginx

nginx does not start on its own. To get nginx running, type:
sudo service nginx start

You can confirm that nginx has installed an your web server by directing your browser to your IP address. You can run the following command to reveal your VPS's IP address.
ifconfig eth0 | grep inet | awk '{ print $2 }'

Step Four—Install PHP


To install PHP and PHP-FPM, open terminal and type in these commands. We will configure the details of nginx and php details in the next step:
sudo apt-get install php5 php5-fpm

Step Five—Configure php


We need to make one small change in the php configuration.Open up php.ini:
 sudo nano /etc/php5/fpm/php.ini

Find the line, cgi.fix_pathinfo=1, and change the 1 to 0.
cgi.fix_pathinfo=0
If this number is kept as 1, the php interpreter will do its best to process the file that is as near to the requested file as possible. This is a possible security risk. If this number is set to 0, conversely, the interpreter will only process the exact file path—a much safer alternative. Save and Exit. 

Restart php-fpm:
sudo service php5-fpm restart

Step Six—Configure nginx


Open up the default virtual host file.
sudo nano /etc/nginx/sites-available/default

The configuration should include the changes below (the details of the changes are under the config information):
 [...]
server {
        listen   80; ## listen for ipv4; this line is default and implied
        #listen   [::]:80 default ipv6only=on; ## listen for ipv6

        root /usr/share/nginx/www;
        index index.php index.html index.htm;

        # Make site accessible from http://localhost/
        server_name example.com;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to index.html
                try_files $uri $uri/ /index.html;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
        }

        location /doc/ {
                alias /usr/share/doc/;
                autoindex on;
                allow 127.0.0.1;
                deny all;
        }

        # Only for nginx-naxsi : process denied requests
        #location /RequestDenied {
                # For example, return an error code
                #return 418;
        #}

        #error_page 404 /404.html;

        # redirect server error pages to the static page /50x.html
        #
        #error_page 500 502 503 504 /50x.html;
        #location = /50x.html {
        #       root /usr/share/nginx/www;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

                # With php5-cgi alone:
                fastcgi_pass 127.0.0.1:9000;
                # With php5-fpm:
        #       fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /\.ht {
               deny all;
        }
}
[...]

Here are the details of the changes:

  • Add index.php to the index line.

  • Change the server_name from local host to your domain name or IP address (replace the example.com in the configuration)

  • Uncomment the correct lines in “location ~ \.php$ {“ section

Save and Exit

Step Seven—Create a php Info Page


We can quickly see all of the details of the new php configuration. 

To set this up, first create a new file:
sudo nano /usr/share/nginx/www/info.php

Add in the following line:
<?php
phpinfo();
?>

Then Save and Exit. 

Restart nginx
sudo service nginx restart

You can see the nginx and php-fpm configuration details by visiting http://youripaddress/info.php

Your LEMP stack is now set up and configured on your virtual private server.






우분투 패키지로 phpmyadmin 설치했는데 안 들어가질 때

아마도 아래 명령어로 설치했거나, 시냅틱 패키지 관리자 내지는 우분투 소프트웨어에서 phpmyadmin을 설치했을 것이다.

sudo apt-get install phpmyadmin

그런데 http://localhost/phpmyadmin 으로 들어가지지 않는 경우가 있다.

그럴 때는 아래 명령어로 아파치 설정 파일을 열어서 편집을 해야 한다.

sudo vi /etc/apache2/apache2.conf

그래서 적당한 곳에 아래 설정을 추가한다. (그냥 속편히 맨 아래 넣자.)

# Enable PhpMyAdmin
Include /etc/phpmyadmin/apache.conf

그 후 아파치 재시작

sudo /etc/init.d/apache2 restart


우분투 리눅스에서 APM(Apache+Php+MySQL)을 설치해 보도록 하겠습니다.

이 글은 컴파일해서 쓰는게 아니라 패키지 자체설치로 초보자도 간단하게 설치해볼수 있습니다.

APM이란 리눅스에서 웹서버를 구성할때 많이 쓰는 프로그램의 일반적인 통합명칭입니다.

부르기 쉽게 한데로 모아서 APM이라고 부릅니다. 요즘은 LAMP(Linux + Apache + MySQL + Php/Perl,Python)환경 이라고도 부르기도 합니다.

아파치(Apache)는 웹서버 자체로서 일반적인 프로토콜인 Http프로토콜을 사용합니다. 또한 Https,ftp등도 지원을 하게 됩니다.

MySQL은 데이터베이스 엔진으로서 각종 게시판이나 데이터베이스를 사용해야할때 많이 쓰이는 프로그램입니다. MySQL뿐만 아니라 PostgresSQL도 사용이 가능합니다.

PHP는 스크립트언어로서 웹페이지를 구성할수 있는 언어중 하나입니다. 많은 웹 프로그램들이 php로 작성 되고 있습니다.


일반적으로 설치순서는 Apache -> MySQL -> PHP 등으로 이루어 지게 됩니다.


1) 설치 

1.Apache

먼저 Apache를 설치하여 보겠습니다. 버전은 apache2버전을 기준으로 하겠습니다.

터미널을 열고 다음 명령을 입력합니다.

 

sudo apt-get install apache2


    다음으로 mysql을 인증을 위한 모듈을 설치하겠습니다.


    sudo apt-get install libapache2-mod-auth-mysql


      다음으로 MySQL


      sudo apt-get install mysql-server mysql-client

        설치가 완료되면 MySQL서버가 자동으로 시작이 됩니다.


        마지막으로 PHP 버전은 PHP5 기준으로 하겠습니다.

        마찬가지로 터미널에서 다음을 입력합니다.

        sudo apt-get install php5-common php5 libapache2-mod-php5

          MySQL과 연동하기 위한 모듈을 설치합니다. 

          sudo apt-get install php5-mysql

            이상으로 설치가 완료 되었습니다.


            아파치 웹서버를 제 시작하겠습니다. 

            sudo /etc/init.d/apache2 restart

              MySQL서버도 정상적으로 작동하는지 확인해 보고 작동을 안한다면 restart 를 해줍니다.

              sudo netstat -tap | grep mysql

              명령을 줬을때 

              tcp 0 0 localhost.localdomain:mysql *:* LISTEN -

              와 비슷한 것을 보면 정상이고 그렇지 않다면

              sudo /etc/init.d/mysql restart

              로 재시작을 해줍니다.


              모든게 정상이라면

              에디터를 열고 웹서버의 디렉토리(일반적으로 "/var/www" 에서 phpinfo.php라는 파일을 만들고 다음의 소스코드를 넣어 줍니다.

              1. <?php
              2. print_r(phpinfo());
              3. ?>

              그리고 웹브라우저를 열고 실행을 시켜봅니다.


              일반적으로 http://호스트주소/phpinfo.php 로 주소를 열면 됩니다.


              다음과 같은 화면이 나오면 웹서버를 위한 환경이 구성이 되었습니다.

              스크롤을 내려 Apache 와 MySQL 등을 찾아 제대로 연결이 되었는지 확인해 봅니다.

              각종 사항은 설정마다 다르게 나올것입니다.

               

              사용자 삽입 이미지

              phpinfo



              phpinfo.png

              2) 설정

              1. 아파치 

              아파치의 기본설정 파일은 /etc/apache2/apache2.conf

              포트번호, 문서의루트, 모듈, 각종 로그파일, 가상 호스트 등을 설정할수 있습니다.

              자세한 사항은 아파치 문서를 참조하시기 바랍니다.


              2.  MySQL

              mysql 의 관리자 암호는 처음에는 지정이 되지 않은 상태입니다.

              관리자 암호를 설정하기 위해서는 

              sudo mysqladmin -u root password newrootsqlpassword 

              sudo mysqladmin -p -u root -h localohost password newrootpassword

                을 입력합니다.

                첫번째 줄만 실행해도 설정은 될것입니다.

                MySQL 설정파일은 /etc/mysql/my.cnf 파일이고 로그 파일, 포트 번호등을 설정할수 있습니다.


                이상으로 훌륭한 웹서버 환경을 구축하게 되었습니다.

                처음 시작이니 만큼 보다 많은 노력과 시간을 들이는게 중요하다고 봅니다.

                여러 문서를 참조하여 실력을 쌓으시길 바랍니다. 행운을 빕니다~ 


                403 Forbidden



                Forbidden

                You don't have permission to access / on this server.

                Apache/1.3.27 Server at localhost Port 80


                서버 운영시 접속이 안돼 이런 오류가 나는 경우가 있는데,

                이는 아파치를 구동하는 nobody 계정에서 해당 디렉토리에 접근할 수 없는 과정에서 발생하는 퍼미션 오류라고 합니다.




                <해결 방법>

                /home/aaa/public_html/ 으로 구성되어 있을 경우

                chmod 701 사용자ID 또는 chmod 711 사용자ID 정도의 권한을 부여하면 됩니다.

                즉 chmod 701 aaa 또는 chmod 711 aaa 입니다. 보통 711을 많이 사용하시네요.



                위 조치로도 해결이 안되면 http://youdw.egloos.com/171450 도 참고.



                PS> 지금 XE 업글하면서 호환성에 문제가 있어 스킨 등을 확 손보고 있습니다.

                출처 : http://itviewpoint.com/110443

                리눅스에 useradd 로 password와 계정들을만든후
                vi /etc/passwd 들어가보시면 제일 밑에 
                님이 만드신 아이디가 잇으면 보일거에요
                그중에 root 가 있어요
                없을 수도 있지만 상관 없어여
                만약에 user 라고 계정을 만들었으면
                vi /etc/passwd   에   제 일 밑에  :9999 눌러서 가 보면
                user :X:500:500::/home/user:/bin/bash
                이런식으로 되있을거에요
                다른 건 상관 없구
                X : 500:500
                에서  앞에 500 이라고 되어있는걸
                0 으로 바꿔주시면  root 권한이 주어집니다
                user :X:0:500::/home/user:/bin/bash

                '공부 > 일반' 카테고리의 다른 글

                리눅스(우분투12.04)서버에 Nginx, Mysql, Php 설치하기  (0) 2012.10.03
                리눅스서버에 APM설정  (0) 2012.09.11
                리눅스 서버 FTP 세팅  (0) 2012.08.29
                리눅스접속  (0) 2012.08.24
                티스토리 코드하이라이터 사용2  (0) 2012.08.23


                 리눅스를 사용하면서 FTP 설정을 해 놓으면 여러모로 편한 점이 있습니다. 저의 경우엔 주로 Windows 환경의 OS를 사용하다가 웹 서버에 어떤 파일을 업로드 하거나 웹 페이지를 변경 할 일이 있으면 FTP를 이용해서 변경을 합니다. 직접 서버에 접속을 해서 변경할 수도 있지만 아무래도 편집기 환경이 윈도우와 다르기 때문에 작업하기가 힘들 수도 있기 때문이죠. 

                 이럴 때, FTP 가 사용 가능하면 좋은데, 이번에 우분투를 사용하게 되어 우분투에 FTP를 설정하는 방법을 포스팅 하게 되었습니다. ( 나중에 보고 따라할 수도 있어서 기록 해 놓으려구요 ㅎㅎ )

                 일단 저는 우분투에 SSH를 이용한 터미널 작업으로 세팅하도록 하겠습니다. 서버 관리에서 직접 서버 컴퓨터에 가서 모니터 켜고 콘솔 작업을 하는 사람은 많지 않을테니까요 ㅋㅋ 저는 한글 PUTTY를 이용해서 접속을 했습니다. 일반 Putty로 접속을 하니까 우분투의 한글이 깨지더라구요. 세팅하기 귀찮아서 한글 PUTTY로 접속을 하였습니다. 

                한글 putty 다운로드


                 네 우분투에 FTP를 설치하는 명령어는 매우 간단합니다. 

                $ sudo apt-get install vsftpd
                $ sudo vi /etc/vsftpd.conf

                두 명령어를 입력하시면 FTP 데몬이 설치되고, 설정 페이지가 나옵니다. 
                여기서 아래의 세군데의 주석을 해제 하시고, 다음과 같이 세팅을 해줍니다. 
                ==================== 편집기 ======================
                anonymous_enable=NO
                local_enable=YES
                write_enable=YES
                =================================================


                $ sudo /etc/init.d/vsftpd restart

                그리고 FTP 데몬을 재시작 시켜 주시면 완료!!

                 
                그럼 직접 따라해 볼까요? PUTTY를 이용해서 여러분의 서버에 접속을 하시면 다음과 같은 화면이 뜹니다. 



                이제 첫 번째 명령어를 써 넣습니다. 
                첫번째 명령어는 
                $ sudo apt-get install vsftpd

                였죠? 이 명령어는 vsftpd 라는 데몬을 설치하라는 명령어입니다. 




                여기서 한글이 깨져서 나오는 경우가 있는데 그런 경우엔 다음 링크를 참조하시기 바랍니다. 

                2010/07/22 - [컴퓨터 공학/OS/Linux/Windows] - putty 한글 깨짐 현상 해결

                네 이제 vsftpd 데몬이 설치가 되었구요. 

                $ sudo vi /etc/vsftpd.conf

                위 명령어를 입력하면 vsftpd 의 설정에 관한 내용들을 볼 수 있습니다. 
                굉장히 긴데요. 문장이 #으로 시작하는 것은 주석처리가 된 것으로 설정에 영향을 미치지 않는 부분들입니다. 


                설정 내용 중에 잘 보시면 위의 3가지를 볼 수 있습니다. 
                각각 다음과 같이 변환을 해 줍니다. 

                anonymous_enable=NO
                local_enable=YES
                write_enable=YES

                맨 처음 anonymous_enable 은 YES 에서 NO로 바꿔 주시구요
                다음 두개는 맨 앞의 # 을 제거해 주시기만 하면 됩니다. 

                VI 에디터 사용법은 다음 링크를 따라가 보시기 바랍니다. 

                http://www.cyworld.com/duck_info/3551206


                $ sudo /etc/init.d/vsftpd restart

                그리고 위 명령어를 입력하여 데몬을 다시 시작합니다. 




                이제 FTP 프로그램으로 접속을 해보겠습니다. 
                간단하게 알 FTP로 실험을 해보겠습니다. 


                접속이 잘 되네요. 
                근데 한글은 또 왜 깨지나요 ㅋㅋ 
                이제 서버와 여러분의 컴퓨터와의 FTP 설정이 끝났습니다. 그냥 웹 하드처럼 쓰셔도 될 듯 하네요.

                출처 : http://plusblog.tistory.com/416

                '공부 > 일반' 카테고리의 다른 글

                리눅스서버에 APM설정  (0) 2012.09.11
                리눅스 일반계정 관리자권한주기  (0) 2012.08.31
                리눅스접속  (0) 2012.08.24
                티스토리 코드하이라이터 사용2  (0) 2012.08.23
                티스토리에 부트스트랩 적용하기  (0) 2012.08.22

                + Recent posts