title: Selenium Firefox webdriver results in error: connection refused
body: <p>Same setup was working in another Linux server. I just migrated to AWS (Centos 7) and am now facing this problem.</p>
  
  <ul>
  <li>Mozilla Firefox 52.6.0</li>
  <li>Selenium 3.8.1</li>
  <li>Python 2.7</li>
  </ul>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>from pyvirtualdisplay import Display
  from selenium import webdriver
  
  display = Display(visible=0, size=(1366, 768))
  display.start()
  browser = webdriver.Firefox()
  browser.set_window_size(1366, 768)
  browser.get('http://www.vionblog.com/')
  browser.set_script_timeout(30)
  browser.set_page_load_timeout(30) # seconds
  browser.save_screenshot('vionblog.png')
  
  browser.quit()
  display.stop()
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <blockquote>
  <pre><code>Traceback (most recent call last):
    File "test.py", line 11, in &lt;module&gt;
      browser = webdriver.Firefox()
    File "/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 158, in __init__
      keep_alive=True)
    File "/usr/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 154, in __init__
      self.start_session(desired_capabilities, browser_profile)
    File "/usr/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 243, in start_session
      response = self.execute(Command.NEW_SESSION, parameters)
    File "/usr/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
      self.error_handler.check_response(response)
    File "/usr/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 237, in check_response
      raise exception_class(message, screen, stacktrace)
  selenium.common.exceptions.WebDriverException: Message: connection refused
  </code></pre>
  </blockquote>