Pages

Subscribe:

Ads 468x60px

2013年7月29日 星期一

酒保機器人! 開瓶.端咖啡難不倒

來看日本最新的科技可以讓機器人自己開瓶、倒果汁、還有端咖啡跟爬樓梯,動作相當精準,這樣的高超技術,令人驚嘆。
  你知道現在的機器人有多先進嗎?日本現在最新的科技可以讓機器人自己開瓶倒果汁、端咖啡和爬樓梯,動作相當精準,現場的高超技術,讓人看了相當驚嘆,推著餐車 走出來,緩緩走向桌子,接著拿起,左邊的綠色杯子,用手指頭 抓緊杯蓋,精準的旋轉開來,把裡頭的果汁,一滴不漏倒進紙杯當中。
   它的手幾乎跟人一模一樣,主人交代一下,雙手立刻抬上來,端起咖啡,走向觀眾檯前 平穩的放在桌上,手的關節已經開發的相當完全,至於腳呢,看著機器人左一步右一步,走上樓梯,下台時來個黃金右腳,漂亮一球 驕傲的叉起腰來,最後還大跳機械舞,似乎在感謝觀賞下台一鞠躬,機器人的可愛模樣,讓所有觀眾為之著迷,日本的機器人科技,又邁前了一大步。

機器人酒保 呼乾啦

機械電子工程師、仿生機器人公司老闆薛佛(Ben Schaefer)研發製造的仿生機器人酒保「卡爾」(Carl),不但能在德國東部城鎮伊爾默瑙(Ilmenau)的機器人酒吧調雞尾酒,還能跟客人聊上兩句,堪稱全能調酒師。有不少觀光客慕卡爾名號而來,酒吧成為當地熱門景點之一。圖為薛佛26日與正在為客人調酒的「卡爾」互動。(圖︰路透/文︰國際新聞中心)

2013年7月25日 星期四

How to build a toilet-flushing Lego robot

By  posted Sep 28th, 2007 at 8:12 AM
Tired of flushing your own toilet? Build a RoboFlush! RoboFlush is a simple Lego NXT Mindstorms Robot designed to flush a toilet automatically. It also comes with a manual flush option! Check out these instructions to build your own. Mike D'Amour came up with the idea, and Will Gorman built and documented RoboFlush.

How much do you know about Lego Robotics? Take the Lego Mindstorm Quiz atSomeTests.com

RoboFlush:
 

The Video:
 

The Flusher:

The flusher is mounted under the toilet bowl cover for the extra weight. Flushing requires no gearing, the NXT motor is strong enough to flush every time.


The NXT and Manual Flush:
 

The program for this robot is a little complicated in the NXT graphical language. It would be much simpler to understand in a traditional language like Java.


The Ultrasonic Sensor:
 

The ultrasonic sensor waits till it detects someone in range, then waits till that person is out of range. A polite thank you, and then flush!

The Lucky Toilet:  


資料來源

2013年7月23日 星期二

二信高中創研社辦機器人夏令營

二信高中創研社今年首度舉辦「飛行器機器人夏令營」,第一場對象為該校國中部一年級新生,多軸飛行器、機器人勁舞、迷宮秀等,國中生超開心,興緻高昂,第二場開放基隆市國小學生報名,反應相當熱烈,短短幾天已全數額滿。
二信高中表示:該校創研社成立近十年來,在全國創意競賽中獲獎無數,參賽學生累積出不少經驗,加上該校電機科及國中部的指導教師群,他們規畫出一套暑期夏令營課程,於七月二十、二十一舉辦國中組,預計在二十七、二十八日舉辦國小組,希望藉由寓教於樂的活動,啟發孩子無限的創意與技能。
二信高中指出,創研社師資群包括國中部數學教師郭世昌,自然教師盧丁諱、楊宙諭、電機科劉兆祥主任、機械科賴宏彰老師及廣設科謝啟駿主任,他們平日投入在學校教育工作,課餘時間玩玩科技產品,一群老師教學相長,玩出樂趣,將「玩具」、「科技」與學校課程結合,組成創研社,指導學生創意思考,從「玩具」與「科技」中引發學生的學習樂趣,參加各項創思競賽。
創研社指導老師郭世昌表示,目前我們在玩的「多軸飛行器」,有三軸、四軸、六軸、八軸,常用作空拍風景、空中氣體收集檢測、活動攝影,救災、高樓火警監控、國土森林監測…等,要完成一項攝影、監測工作,必須運用多項科技產品,從中可預先學習到很多理論與實務操作的技能,這次的夏令營除了讓學生能體驗科技的進步外,也藉由孩子喜歡的樂高玩具及機器人實作,啟發學生的無限創意及學習技能。
國中組已在二十、二十一日滿落幕,參加的二信國中部國一新生四十餘位,當天課程包括組裝機器人、程式及超音波感應教學,另外還有飛行秀、迷宮競賽、飛行模擬器練習及飛行競賽,課程活潑生動,參與的學生興緻高昂,玩得很開心,結束後每人都獲得一份與課程有關的飛行器或機器人,收穫滿行囊。

台灣股市資訊網

發現一個網站
資料整理很詳盡

值得推薦

http://goodinfo.tw/StockInfo/index.asp

An Easy Link between Arduino and Android

Annikken Andee is an Arduino Shield that lets you connect your Arduino to your Android phone via bluetooth easily. With the free Annikken Andee Library and Android App, you can create your very own monitor and control user interface on your Android Devices from the Arduino IDE. This simply means you are NOT required to develop any Android Apps at all.

Works with Arduino


Annikken Andee is designed to fit and work with Arduino Uno, Arduino Mega and Arduino Leonardo. For variants like Arduino Nano, you will have to connect the ICSP header correctly and also pin 8 together. Support for other Arduinos (e.g Due) are still currently being tested.
Annikken Andee and Arduino communicates using Arduino's ICSP header (SPI) and pin 8, leaving the rest of the pins for connection with other sensors or modules. Refer to manual for details.

Code in Arduino - Create Android Interface


Annikken Andee differentiates itself from other bluetooth shields by allowing Arduino developers to have an touch and display Android interface with NO NEED for any Android development effort.
Andee Library  
Instead of providing Android project samples which you need to modify and adapt to your application, we give you an Android App and a Annikken Andee library for Arduino. What this means is that you will be using the easy to use Arduino environment to create data displays or buttons on the Android App - as shown above.

Wireless Bluetooth Data Transmission

Bluetooth Logo FCC CE logo
Annikken Andee and the Android app communicates using the FCC CE certified WT11i bluetooth module from Bluegiga. This module is capable of reaching distances of up to 350 meters line-of-sight module-to-module. (For actual distance, it depends on the bluetooth chip of your Android device and also how/where Annikken Andee is being positioned.)

Types of Android Displays

There are three types of displays you can create on the Android App with colors you can customize using argb values. Displays can be configured to occupy quarters, thirds, half or full width of your Android screen.
  • Data Displays
    These are displays used for providing user with feedback. Up to 3 text fields each display which you can choose to display any text or numbers you want.
  • Data Display Screenshot Code Snippet
  • Button Displays
    These displays catch user inputs from Android user. Your Arduino code can call a function to find out if the button was pressed or not, and perform handling functions from there on.
  • Button Displays Code Snippet
  • Keyboard Displays
    Similar to button displays. Shows the Android keyboard for users to enter text, numbers or password. Arduino can retrieve this value using a function call.
  • Keyboard displays Code Snippet

Onboard SD Card

SD Card SlotSD Card Code Example
Annikken Andee provides an sd card slot for use a non-volatile data storage. You can use it to write log data from your Arduino application. For ease of use, we provide read and write functions from Annikken Andee library for Arduino. In addition, you can use an sdcard to upgrade Annikken Andee's firmware with the latest images to ensure you get the most recent features.

Reviewing Numeric Data Using Graph

landscape Analog andee graph
If you data happens to be numeric, our Annikken Andee App is able to collect the data and plot a graph for it. This helps you to visualize numerical data for analytical purposes.

Use Phone Functions From Arduino

When your Android phone is connected to Annikken Andee + Arduino, you can write code (in Arduino) to:
  • Send SMS to a recipient
  • Vocalize using Text-to-Speech
  • Create a notification on Android

Lego Mindstorms NXT Scorpion (kits 9797 + 9695)

Lego Mindstorms NXT Robot Arm (kits 9797 + 9695)

LEGO 360° Milling Machine

LEGO 3D Milling Machine AMAZING!

Lego Mindstorms NXT Ball Roller Coaster (kits 9797+ 9695)

2009 日本國際食品工業展 FOOMA JAPAN

投籃樂高機器人

LEGO可自動分類 樂高迷恨到口水流

game of life with 8x8 bicolor led matrix

I recently got one of those 8x8 LED matrices and I was playing with some Game of Life patterns when I found this pretty repeating pattern. I found it by starting with some random patterns. If you look closely you can see the pattern becoming a mirrored version of itself halfway through. Apparently the pattern doesn't repeat like this on an infinite grid but on this wrapping 8x8 grid it does ;-) FYI, the LED matrix is a bicolor one (green/red) and has an I2C interface (http://www.adafruit.com/products/902). I'm using the colors as follows: - newly created cells are green - cells that are at least 10 generations old are red - other living cells are yellow (simultaneously green+red) It's hookup up to my Arduino Uno r3. here's a video:Youtube

Code
/*
I recently got one of those 8x8 LED matrices and I was playing with some Game of Life patterns when I found this pretty repeating pattern. I found it by starting with some random patterns. If you look closely you can see the pattern becoming a mirrored version of itself halfway through. Apparently the pattern doesn't repeat like this on an infinite grid but on this wrapping 8x8 grid it does ;-)
 
FYI, the LED matrix is a bicolor one (green/red) and has an I2C interface (http://www.adafruit.com/products/902). I'm using the colors as follows:
- newly created cells are green
- cells that are at least 10 generations old are red
- other living cells are yellow (simultaneously green+red)
 
It's hookup up to my Arduino Uno r3.
 
here's a video: http://www.youtube.com/watch?v=Ee2hOaQ2RDI
 
*/
 
#include
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"
 
boolean cells[8][8];
 
Adafruit_BicolorMatrix matrix = Adafruit_BicolorMatrix();
 
// game of life
int next[8][8];
 
void setup() {
Serial.begin(9600);
Serial.write("hello");
 
randomSeed(analogRead(0));
for (int r=0 ; r<8 r="" span="">
for (int c=0 ; c<8 c="" span="">
if (random(2) >0)
next[r][c] = 1;
}
}
matrix.begin(0x70); // pass in the address
}
 
void loop() {
 
game_of_life();
}
 
int current[8][8] =
{ {0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,1,1,1,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0} };
int mod(int a) { return (a+8)%8; }
 
void game_of_life() {
matrix.clear();
// draw
for (int r=0 ; r<8 r="" span="">
for (int c=0 ; c<8 c="" span="">
int color;
if (next[r][c] == 0)
color = 0;
else if (next[r][c] == 1)
color = LED_GREEN;
else if (next[r][c] > 10)
color = LED_RED;
else
color = LED_YELLOW;
matrix.drawPixel(c,r,color);
}
}
matrix.writeDisplay();
// calc next state
for (int r=0 ; r<8 r="" span="">
for (int c=0 ; c<8 c="" span="">
// count alive neighbors
int alive = 0;
alive += current[mod(r+1)][mod(c) ] != 0;
alive += current[mod(r) ][mod(c+1)] != 0;
alive += current[mod(r-1)][mod(c) ] != 0;
alive += current[mod(r) ][mod(c-1)] != 0;
alive += current[mod(r+1)][mod(c+1)] != 0;
alive += current[mod(r-1)][mod(c-1)] != 0;
alive += current[mod(r+1)][mod(c-1)] != 0;
alive += current[mod(r-1)][mod(c+1)] != 0;
if (current[r][c])
if (alive < 2 || alive > 3)
next[r][c] = 0;
else
next[r][c] = current[r][c] + 1;
else
if (alive == 3)
next[r][c] = 1;
}
}
for (int r=0 ; r<8 r="" span="">
for (int c=0 ; c<8 c="" span="">
current[r][c] = next[r][c];
}
}
delay(100);
}

A diy pop-up interactive book made with recycled materials

A diy pop-up interactive book made with recycled materials

A DIY magnetic levitation vehicle to inspire future engineers

A DIY magnetic levitation vehicle to inspire future engineers

2013年7月22日 星期一

Build your own Custom Arduino Remote Control and Lego RC Vehicle!!

Do you like Legos?
Do you like Arduinos?
Do you like RC things that you can bring to life with the flick of a thumb?
I certainly do, so today I’ll be showing you how to make something that combines all of the above into one and go over a ton of other useful techniques and best practices as well!


     I’ll start by giving a brief description of what I made, and then I’ll follow with not just how to make it, but the reasons behind it too! By explaining all the steps involved (like the designplanning3D modelling, and even the Lego-building and laser-cutting!) and the decisions and thought process behind those steps (as well as the CAD files and code), I hope not only to share with you what you will need to make what I have, but also useful background and techniques that you can use not only in your own version of this project, but in all your other DIY projects too! Lastly, if there anything that I might have missed or that you need additional information or clarification about, or if you have any questions whatsoever, please feel free to ask me in the comments or to message me! Now lets get started!

    As you might have guessed from the title or seen in the video, the project I've been hinting towards consists of two parts: a completely custom Arduino remote control, and a servo-powered RC Lego car!

   The Lego part of the RC vehicle is a medium-sized chassis built around a Lego drivetrain with four-wheel drive and four-wheel steering. The RC part is a set of four standard hobby servospowering the drivetrain; an Arduino, for controlling everything; and an XBEE radio, for communication with the remote control. There is also an onboard power supply (it’s an RC car! Of course it has one!).

    The second part of the project is the remote control. It’s about the size of a Gameboy Advance; has a 2.2” LCD color display; is built around an Arduino microcontroller; has a joystick, two potentiometers, and four buttons for input; and has the same type of XBEE radio module the RC vehicle does. All of this is housed in a custom enclosure made entirely from laser-cut acrylic. The remote control supports USB cable operation via the serial port on the Arduino, but it can also be operated off a 9V battery which can be mounted onboard, allowing the entire remote to be operated, well, remotely. Fun stuff.

    Now that you know what you’ll be making, we can start actually making it.
Everything you'll need file-wise is available for download on my site, Kayrus.com.
Here's the link: www.kayrus.com/legos/diy_rc_zip (it should download automatically)
Included in the zip file are the latest Inventor part files (.ipt's), the combined AutoCAD drawing (.dwg), and the latest Arduino code for the car and Handuino (.ino's) and I'll let you all know if I make updates or improvements to these!

Proximity Sensing Origami Flower

Origami is the traditional Japanese art of paper folding.  In this project, with a little help from anArduino, you can bring your origami into the 21st century and make it an interactive art!

The result shown here uses Bare Conductive paint to give an origami flower proximity sensing powers.  When you put your hand close by, it triggers a small vibrating motor, and the flower wiggles around to say "hello!".

Submitted by Ace Monster Toys Hackerspace in Oakland, CA for the Instructables Sponsorship Program

動感科技-機器人,全系列計13集,2013/7/21起,每周日上午08:00於華視主頻動感播出



我看了一集多
覺得很不錯

推薦給各位

http://univisionfilmmaker.com/category/robot/

2013年7月18日 星期四

NXT2.0示範 (播放清單)

香港機械人學院學員作品 - NXT消防升降台車

Lego NXT樂高機器人3D多角度拍攝法

LEGO 樂高 NXT機器人 手機遙控程式寫法

香港機械人學院學員作品 - NXT消防升降台車

IRHOCS 2011 ROBOT BOWLING 機器人保齡球

2011 IRHOCS機器人實作競賽機器人保齡球大賽

2012-2013 FLL&FTC機器人大賽-台灣選拔賽-亞軍

参加2012奧林匹克機器人大賽國際賽介紹短片

1010819大台中新聞-2012年國際奧林匹克機器人大賽-全國選拔賽中區初賽

2008 台北縣市校際盃機器人大賽國小、國中冠軍結構

WRO2010南投縣校際盃 高中組機型

LEGO (播放清單)

WRO2011台中市機器人校際盃國小組機型

【2013.05.19】路考比高下 機器人闖關汽車駕訓 -udn tv

2013年7月17日 星期三

當兵什麼都是假的,只有平安退伍才是真的

本人是海軍陸戰隊下士班長退伍,服役期間大多是擔任參一文書,在我服役的時間也曾送一位小兵去關禁閉,至於我營本部本身就是三軍區的禁閉室。關禁閉的人我是看了不少,也從經過66師的禁閉室,憑良心說,如果按照媒體所言,這樣的操練會出事情,那換成陸戰隊那死傷可能就無數了,今天造成一條人命,恐怕還有許多不為人知的秘密,希望未來能夠真相大白水落石出,也才可以還家屬一個公道。
憑良心說,今天的記過對於這些職業軍人來說已經是損失慘重,前途已經黯淡無光。
整個陸戰隊軍旅生涯也出過不少事情,我從新訓中心結訓後,我連上的一位同梯就在家上吊自殺,還記得他的名字叫做丁建中。當我們放完結訓假回到龍泉新訓中心時,就發現氣氛不對,後來才知道出了事情,他是一位台大畢業,更重要的是國小念國語實小,國中我忘了念哪,高中是建中,一路讀書十分順遂,可是卻不小心抽到海陸,ㄟ我是自己抽900多隻簽才24隻海陸,卻讓我中簽。不過還好我一路有人關照,所以混得還不錯。我那位同梯可就不同,擔心未來下部隊的情況,想不開就上吊,據說法醫相驗時全身瘀青十分嚴重,後來才知她會念書,可是身體不太好,結訓前爬個五百障礙就造成這樣的。所以,在軍中有關係就是沒關係,沒關係自己就要多小心。
下了部隊其實才是陸戰隊弟兄苦難的開始,那我那部隊其實管的就有陸戰隊天下第一哨之稱的連隊,位在三軍總醫院附近,一堆弟兄夢寐以求的哨所。那哨所我是去過,憑良心說,還真爽。剛下部隊先在基隆的營部訓練後才下到連隊,也曾被老兵操到趴在地上起不來。不過,我的運氣其實不錯,沒多久與星星王子(劉宗恆,當年他爸是海巡署的中將)一同受訓後,沒多久就直接從兩兵晉升下士,當時這堆老兵看多超不爽,暗地裡不斷早我麻煩。不過,這些老兵日後就知道我的利害,點召點死你...哈哈哈
服役期間最有印象的就是連上一位小兵被指揮部徵調去廚房,結果這小子晚上偷溜出去,遇到臨檢時,結果他竟然掏出軍人身分證,接著那假單呢??哈哈,後來被憲兵送回指揮部,我就知道事情大條了。最後,連長裁示送三軍區禁閉室關了一個月。
還記得我送他去關,其實程序一天就完成了並不像媒體所說,本來要七天結果變成一天。不過,我營部這禁閉室其實不是陸戰隊很操的地方。明德班是關管訓份子應該是對沒人性的,接下來就是兩師(那時候稱師,現在改為旅)的禁閉室,據了解也是每天做不完的體能。不過,這些都是犯了重大軍紀才需要關。不像這次,我認為這種雞毛蒜皮的小事需要這樣嗎?況且要退伍了需要這樣嗎??有特別給他整理...很難相信沒有。
前國防部長蔣仲苓先生曾說:哪個部隊不死人。憑良心說還真不少,但是一個好好的男孩到部隊常常不能變成男人,而是變成一個阿達甚至為國捐軀其實不在少數。

所以,當兵什麼都是假的,只有平安退伍才是真的

雖然,本人號稱皇家陸戰隊,三等士官長(等吃飯、等放假、等領錢)退伍,但在服役期間本人還是戰戰兢兢努力完成長官交付的任務,最後順利退伍。
像我那時的人事官就因為跟營長不對盤,.後來調去參加兩棲訓,成為蛙兵排長,後來如何我就不知道了。也希望他目前一切安好。



2013年7月14日 星期日

美最先進機器人 終極目標照顧人

〔編譯俞智敏/綜合報導〕美國國防部先進研究計畫局(DARPA)所研發的人形機器人「亞特拉斯」(Atlas)11日正式對外亮相(見圖,取自網路),亞特拉斯身高188公分,體重達150公斤,外形看起來就像是剛從好萊塢科幻片中走出來的機器人。
事實上,美國國防部與波士頓動力公司(Boston Dynamics)研發亞特拉斯的最主要目的,是要讓它代替人類從事最危險、風險最高的工作,例如在核子反應爐爐心熔毀時進入現場處理、關閉漏油的深海鑽油平台,或者協助撲滅山林大火等。假如亞特拉斯證明它能夠勝任這些極端危險的工作,其後代「子孫」則有可能獲准處理更重要的任務,例如協助照顧老人和病人。
亞特拉斯是波士頓動力公司在美國國防部資助下研發完成,波士頓動力公司過去也曾成功研發出無頭機器人LS3 、能夠爬牆、外形類似壁虎的機器人RiSE,以及時速達47公里的四腳機器「獵豹」等。
亞特拉斯身上裝有28個液壓啟動的關節,不僅能夠搬運重物,還能迅速恢復平衡。亞特拉斯的頭上則裝有名為「光達」(lidar )的雷射測距工具,提供它周邊環境的詳細立體地圖。此外,亞特拉斯還有兩組略有不同、分由iRobot公司及桑迪亞國家實驗室(Sandia National Labs)提供的機械手。未來亞特拉斯的手上將裝有更多感應器,讓它能夠使用人類的工具。
亞特拉斯目前仍需靠纜線提供冷卻水及高壓電力,但最終目標是在2014年研發出無線版機器人。
亞特拉斯及其他幾具機器人都參加了DARPA機器人比賽,這項比賽的目的是要激勵各界研發出能在危險、複雜的緊急狀況下以遙控方式指揮的救災機器人,參加遙控軟體設計比賽的7支民間隊伍將可使用亞特拉斯來展示其軟體效能。
儘管亞特拉斯的外形極為神似電影「魔鬼終結者」中的機器人原型,但DARPA堅稱亞特拉斯並非設計來執行「對抗性」軍事任務,而將純粹用於人道救援任務,機器人比賽就是受到2011年日本福島核災所啟發。DARPA當時曾派出一批輪型機器人前往福島協助救災,只可惜機器人無法克服地面的瓦礫障礙,或執行非常複雜的任務,最後無功而返。
(圖/翻攝自BBC NEWS

2013年7月8日 星期一

Generative Product Design

Generative Design Workshop 10/29-11/09 in MCUT

Grasshopper

For designers who are exploring new shapes using generative algorithms, Grasshopper® is a graphical algorithm editor tightly integrated with Rhino’s 3-D modeling tools. Unlike RhinoScript, Grasshopper requires no knowledge of programming or scripting, but still allows designers to build form generators from the simple to the awe-inspiring.


http://www.grasshopper3d.com/

GJD3D

Generative Jewelry and Fashion Design are for  designers who are exploring new shapes using generative algorithms,Grasshopper® is a graphical algorithm editor tightly integrated with Rhino’s 3-D modeling tools. Unlike RhinoScript, Grasshopper requires no knowledge of programming or scripting, but still allows designers to build form generators from the simple to the awe-inspiring.
Generative Jewelry and Fashion Design with Rhino are a new way to model where a design describes a change, it is the transition from entities to operations. A form is created by a series of mathematical operations, instead of being the outcome of applying a conventional command. 
Generative Jewelry and Fashion Design are a "Must Have" complement for any professional applications or Rhino users.
Generative Jewelry and Fashion Design 3D is a social network

http://www.gjd3d.com/

2013年7月7日 星期日

CentOS 6.4安装配置LNMP服务器(Nginx+PHP+MySQL)

这篇文章主要介绍了CentOS 6.4下配置LNMP服务器的详细步骤,需要的朋友可以参考下
准备篇
1、配置防火墙,开启80端口、3306端口
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT #允许80端口通过防火墙
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT #允许3306端口通过防火墙
备注:很多网友把这两条规则添加到防火墙配置的最后一行,导致防火墙启动失败,
正确的应该是添加到默认的22端口这条规则的下面
如下所示:
################################ 添加好之后防火墙规则如下所示################################
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
#######################################################################################
/etc/init.d/iptables restart #最后重启防火墙使配置生效
2、关闭SELINUX
vi /etc/selinux/config
#SELINUX=enforcing #注释掉
#SELINUXTYPE=targeted #注释掉
SELINUX=disabled #增加
:wq #保存退出
shutdown -r now #重启系统
3、安装第三方yum源
yum install wget #安装下载工具
wget http://www.atomicorp.com/installers/atomic #下载
sh ./atomic #安装
yum check-update #更新yum源
安装篇
一、安装nginx
yum remove httpd* php* #删除系统自带的软件包
yum install nginx #安装nginx 根据提示输入y进行安装
chkconfig nginx on #设置nginx开机启动
service nginx start #启动nginx
二、安装MySQL
1、安装MySQL
yum install mysql mysql-server #输入Y即可自动安装,直到安装完成
/etc/init.d/mysqld start #启动MySQL
chkconfig mysqld on #设为开机启动
cp /usr/share/mysql/my-medium.cnf /etc/my.cnf #拷贝配置文件(注意:如果/etc目录下面默认有一个my.cnf,直接覆盖即可)
2、为root账户设置密码
mysql_secure_installation
#回车,根据提示输入Y,输入2次密码,回车,根据提示一路输入Y,最后出现:Thanks for using MySQL!
MySql密码设置完成,重新启动 MySQL:
/etc/init.d/mysqld restart #重启
/etc/init.d/mysqld stop #停止
/etc/init.d/mysqld start #启动
三、安装PHP5
1、安装PHP5
yum install php php-fpm #根据提示输入Y直到安装完成
2、安装PHP组件,使 PHP5 支持 MySQL
yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt
#这里选择以上安装包进行安装,根据提示输入Y回车
chkconfig php-fpm on #设置php-fpm开机启动
/etc/init.d/php-fpm start #启动php-fpm
配置篇
一、配置nginx支持php
cp /etc/nginx/nginx.conf /etc/nginx/nginx.confbak#备份原有配置文件vi /etc/nginx/nginx.conf #编辑
user nginx nginx; #修改nginx运行账号为:nginx组的nginx用户
:wq #保存退出
cp /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.confbak #备份原有配置文件vi /etc/nginx/conf.d/default.conf #编辑
index index.php index.html index.htm; #增加index.php
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
#取消FastCGI server部分location的注释,并要注意fastcgi_param行的参数,改为$document_root$fastcgi_script_name,或者使用绝对路径
service nginx restart #重启nginx
二、php配置
vi /etc/php.ini #编辑
date.timezone = PRC #在946行 把前面的分号去掉,改为date.timezone = PRC
disable_functions =
passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,ope
nlog,syslog,readlink,symlink,popepassthru,stream_socket_server,escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdns
rr,getservbyname,getservbyport,disk_total_space,posix_ctermid,posix_get_last_error,posix_getcwd,
posix_getegid,posix_geteuid,posix_getgid,
posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,
posix_getppid,posix_getpwnam,posix_getpwuid, posix_getrlimit, posix_getsid,posix_getuid,posix_isatty,
posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,
posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname
#在386行 列出PHP可以禁用的函数,如果某些程序需要用到这个函数,可以删除,取消禁用。
expose_php = Off #在432行 禁止显示php版本的信息
magic_quotes_gpc = On #在745行 打开magic_quotes_gpc来防止SQL注入
short_open_tag = ON #在229行支持php短标签
open_basedir = .:/tmp/ #在380行 设置表示允许访问当前目录(即PHP脚本文件所在之目录)和/tmp/目录,可以防止php木马跨站,如果改了之后安装程序有问题(例如:织梦内容管理系统),可以注销此行,或者直接写上程序的目录/data/www.osyunwei.com/:/tmp/
:wq! #保存退出
三、配置php-fpm
cp /etc/php-fpm.d/www.conf /etc/php-fpm.d/www.confbak #备份原有配置文件
vi /etc/php-fpm.d/www.conf #编辑
user = nginx #修改用户为nginx
group = nginx #修改组为nginx
:wq #保存退出
测试篇
cd /usr/share/nginx/html
vi index.php #添加以下代码
phpinfo();
?>
:wq! #保存退出
chown nginx.nginx /usr/share/nginx/html -R #设置权限
service nginx restart #重启nginx
service php-fpm restart #重启php-fpm
在客户端浏览器输入服务器IP地址,可以看到相关的配置信息!
说明lnmp配置成功!
至此,CnetOS 6.4安装配置LNMP(Nginx+PHP+MySQL)教程完成。

列印出具有條碼的繳費單 - OpenFoundry

列印出具有條碼的繳費單 - OpenFoundry

CMS 優質新秀-Joomla!(下) - OpenFoundry

CMS 優質新秀-Joomla!(下) - OpenFoundry

CMS 優質新秀-Joomla!(上) - OpenFoundry

CMS 優質新秀-Joomla!(上) - OpenFoundry

誰在偷看我的電子信箱? - OpenFoundry

誰在偷看我的電子信箱? - OpenFoundry

Web Security 網站安全基礎篇(二) - OpenFoundry

Web Security 網站安全基礎篇(二) - OpenFoundry

Web Security 網站安全基礎篇(一) - OpenFoundry

Web Security 網站安全基礎篇(一) - OpenFoundry

用開源方案打造網站保鑣 - OpenFoundry

用開源方案打造網站保鑣 - OpenFoundry

以 integrit 監控系統完整性 - OpenFoundry

以 integrit 監控系統完整性 - OpenFoundry

以 mod_evasive 阻擋 D.o.S 攻擊 - OpenFoundry

以 mod_evasive 阻擋 D.o.S 攻擊 - OpenFoundry