element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Blog Quick Pi Server Setup & SFTP Access
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
GPIO Pinout
Raspberry Pi Wishlist
Comparison Chart
Quiz
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: gam3t3ch
  • Date Created: 30 Oct 2017 6:06 PM Date Created
  • Views 792 views
  • Likes 2 likes
  • Comments 0 comments
Related
Recommended

Quick Pi Server Setup & SFTP Access

gam3t3ch
gam3t3ch
30 Oct 2017

I am currently running this on a Raspberry Pi 2 with Debian "Raspbian GNU/Linux 9 (stretch)"

 

1. sudo apt-get update

2. sudo apt-get install apache2

3. sudo mkdir -p /var/www/yourdomain.com/public_html

4. sudo chown -R $USER:$USER /var/www/yourdomain.com/public_html

5. sudo chmod -R 755 /var/www

6. nano /var/www/yourdomain.com/public_html/index.html

 

----------------Add the following to the index.html file-------------

<html>

  <head>

    <title>Welcome to yourdomain.com!</title>

  </head>

  <body>

    <h1>Success!   yourdomain.com is working!</h1>

  </body>

</html>

---------------------------end----------------------------------------

 

7. sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/yourdomain.com.conf

 

------------file should look like this--------------------------------

7.5 sudo nano /etc/apache2/sites-available/yourdomain.com.conf

This is what you will see......

<VirtualHost *:80>

    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/error.log

    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Change it to this......

8. ServerAdmin admin@yourdomain.com

9. ServerName yourdomain.com

10.ServerAlias www.yourdomain.com

11.DocumentRoot /var/www/yourdomain.com/public_html

Now should look like this....

<VirtualHost *:80>

    ServerAdmin admin@yourdomain.com

    ServerName yourdomain.com

    ServerAlias www.yourdomain.com

    DocumentRoot /var/www/yourdomain.com/public_html

    ErrorLog ${APACHE_LOG_DIR}/error.log

    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

12.sudo a2ensite yourdomain.com.conf

13.sudo service apache2 restart

----------optional------------------

14.sudo nano /etc/hosts

    111.111.111.111 yourdomain.com  (ip is local ip of pi)

15.http://yourdomain.com

 

LeechFTP and CuteFtp dont have SFTP (either doesn't work right away or have to configure more. I couldn't get them to work as much as I tried. (couldn't find how to access SFTP))

FileZila has SFTP = Connection right away.

use your pi ip and pi user and password you don't need to enter port 22 as it is the default SFTP port.

 

After my last night message of being sleepy thought I would toss this again as reference for the next time I am too sleepy and need to look at my notes lol  its down and dirty note form.  if you need a explanation on this above just google setting up a pi site and should bring up info on each setting a more in depth walkthrough.

 

Just remember the quickest way to do this is probably ssh into your pi once you first start it up so make sure you go into the settings on the pi (Debian) and enable it.  Then you can just copy and paste into putty or whatever your using.

 

I was going to try unbuntu server this time but will get there yet I just wanted to make sure I had something working.

I ran a wordpress website on the pi for over 2 years  works great low power and as long as you update wordpress here and there its not that bad.

But I prefer to make my own I was being lazy and used wordpress.   So now I get to have some fun now I got the ftp working as it should.

Also make sure to change your pi's password I would also suggest removing pi and user and adding another as well.

 

Think I got that all ok there anyone else have any input or am I missing anything?

Also thanks to those that gave me ideas last night and this morning to get things going properly.

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube